Skip to content

Connecting Google Ads Leads Form To Google Spreadsheets

  • admin 

Connecting Google Ads Leads Form To Google Spreadsheets

Recently for a client, I was tasked with setting up a lead form ad extension within their Google Ads account. Google provides clear instructions on how to do that here: Google Ads Support. This is a great step by step implementation guide, but once I had my Google Ads lead form ad extension set up, I quickly realized that I would have to log into my Google Ads account to download the lead data every time a lead came in. Google did provide a helpful tip that I could set up a webhook URL and a webhook key. However, I ran into another issue: I had no idea what a webhook was!

What is a webhook?

A webhook is a way to automatically send data when a specific event occurs. In the case of a Google leads ad extension, a webhook hooks the data that a user inputs into a lead form and sends that data from Google Ads to a specific place. If you want to learn more about the nitty-gritty of webhooks, check out Red Hat’s Blog covering this.

The second question that eluded me for quite a long time, was the webhook key. What was a webhook key and how could I get one? Well, it turns out the webhook key was a whole lot simpler than I thought it would be.

What is a webhook key?

A webhook key is a secret key that you generate so that the two platforms you are trying to send data between recognize each other. Some when I went to set up the Google leads ad extension in the field that requires a webhook key, I needed to make sure that I created a unique key. This key could be whatever I wanted it to be.

Okay, so I knew what a webhook and webhook key was, my next step was to set up a webhook.

How to set up a webhook for Google ads lead form ad extension.

  1. Set up a New Google Ads Spreadsheet in your Google Drive (example)
  2. Name the Spreadsheet whatever you would like
  3. Rename the tab to Leads
  4. Navigate to Extensions > Apps Script
  5. This should automatically open up a new project
  6. Give the project a name like Client Lead Webhook
  7. Delete any script that is in the file and paste this script into the code editor window
  8. You will need to change two parts of the script: tableId and googleKey
  9. TableID can be found in the URL of your google spreadsheet
    • Example: https://docs.google.com/spreadsheets/d/1r2yb8a4qwSDfDvrE13cv2pjYBjPK8sx48To1w3YsCW0/edit#gid=0
    • In the above url, the tableId = ‘1r2yb8a4qwSDfDvrE13cv2pjYBjPK8sx48To1w3YsCW0’
  10. The googleKey is whatever you would like it to be
    • Example: googleKey = “w3bh00kId”
  11. Then, save changes by clicking Deploy > New deployment
  12. Click the gear icon then select Web app
  13. Name the deployment whatever you would like and change the Who has access to Anyone. Then click Deploy.
  14. You may need to authorize, click Authorize.
  15. You should get a window with a generated URL for the Web app, this is what you copy into the webhook URL for the Google Ads lead form ad extension
  16. If you get an error message, please check out blog post by Aiman Fikri for how to fix it.

Inputting the webhook URL and Key into the Google Ads Lead Form Extension

  1. Navigate to Google Ads
  2. Under Assets > Select the + icon > Select Lead form
  3. Fill out the lead form however you would like
  4. Under the Export leads from Google Ads section, expand the Other data integration options
  5. Fill out the Webhook integration (optional) section
  6. The Webhook URL is going to be the entire URL of the google sheet you created
  7. The Key is the unique googleKey you created for the apps script
  8. Hit Send test data to make sure your lead is populating in the Google Sheet!
  9. If the test worked, then you are done and save the form to your Google Ads account.

As users fill out the lead form, new data will be immediately be added to your google sheet. So, you can share your google sheet with your client and they can have access to the lead form data without you navigating to the interface daily to grab the lead form submission data.

For the above directions with screenshots, please see below:

How to set up a webhook for Google ads lead form ad extension.

1. Set up a New Google Ads Spreadsheet in your Google Drive (example)

2. Name the Spreadsheet whatever you would like

3. Rename the tab to Leads

alt=""

4. Navigate to Extensions > Apps Script

5. This should automatically open up a new project

alt=""

6. Give the project a name like Client Lead Webhook

7. Delete any script that is in the file and paste this script into the code editor window

alt=""

8. You will need to change two parts of the script: tableId and googleKey

alt=""

9. TableID can be found in the URL of your google spreadsheet

a. Example: https://docs.google.com/spreadsheets/d/1r2yb8a4qwSDfDvrE13cv2pjYBjPK8sx48To1w3YsCW0/edit#gid=0

b. In the above url, the tableId = ‘1r2yb8a4qwSDfDvrE13cv2pjYBjPK8sx48To1w3YsCW0’

10. The googleKey is whatever you would like it to be

a. Example: googleKey = “w3bh00kId”

alt=""

11. Then, save changes by clicking Deploy > New deployment

alt=""

12. Click the gear icon then select Web app

alt=""

13. Name the deployment whatever you would like and change the Who has access to Anyone. Then click Deploy.

alt=""

14. You may need to authorize, click Authorize.

alt=""

15. You should get a window with a generated URL for the Web app, this is what you copy into the webhook URL for the Google Ads lead form ad extension

alt=""

16. If you get an error, like below, please check out blog post by Aiman Fikri for how to fix it.

alt=""

Inputting the webhook URL and Key into the Google Ads Lead Form Extension

1. Navigate to Google Ads

2. Under Assets > Select the + icon > Select Lead form

3. Fill out the lead form however you would like

4. Under the Export leads from Google Ads section, expand the Other data integration options

alt=""

5. Fill out the Webhook integration (optional) section

a. The Webhook URL is going to be the entire URL of the google sheet you created

b. The Key is the unique googleKey you created for the apps script

6. Hit Send test data to make sure your lead is populating in the Google Sheet!

7. If the test worked, then you are done and save the form to your Google Ads account.

alt=""

As users fill out the lead form, new data will be immediately be added to your google sheet. So, you can share your google sheet with your client and they can have access to the lead form data without you navigating to the interface daily to grab the lead form submission data.

Hopefully this post saves you some time in figuring out what is a webhook, and how to use it to connect the Google ads lead form extension to Google sheets.

 

Leave a Reply

Your email address will not be published. Required fields are marked *