Testing

Using API Tester

Once you have configured a URL you wish to use for lead handling, test to see if it can handle a request constructed on api_tester_sample. Replace advertiser_lead_handler_url with your own URL and verify if your lead handler is working as expected.

Once the webhook is set up in Google Ads, we recommend you test if your CRM is set up correctly using the test functionality. Otherwise, you may not receive the lead data in your CRM system.

When constructing your lead form in Google Ads, you will see a test button below the webhook set-up:

Note that the set-up interface may look different if you are setting up a lead form on Search.

Once you hit the test button, a sample webhook request is sent to your configured webhook endpoint and a result is displayed. If the request was received successfully by your CRM and the HTML response status code from your system was 200, you will see a green status message:

To complete the test in such a case, please verify that your CRM has correctly received and parsed the sample payload. Without performing this step there is no guarantee that the webhook is working properly.

A sample of the payload that is sent is shown below. The actual request will contain only fields that were selected in the form:

Form fields selected in the example: Name, Phone, Email
Lead type: Test payload sent by webhook testing UI

{
  "lead_id":"MTM4Nzc4MzM2MzpsZWFkX2lkOjE1NTkwODQ5NjQ4MzU",
  "campaign_id":123456,
  "gcl_id":"CKbai8W4xN4CFcoFrwkdyHEByw",
  "user_column_data": [
    {
      "column_name": "Full Name",
      "string_value":"FirstName LastName"
    },
    {
      "column_name":"User Phone",
      "string_value":"1-650-555-0123"
    },
    {
      "column_name":"User Email",
      "string_value":"test@example.com"
    }],
  "api_version":"1.0",
  "form_id":123456789,
  "google_key":"testkey",
  "is_test":true
}

Please note that form_id field value will be set to the actual id of your form if you are performing a test on a form that is already saved. For unsaved forms, a dummy value will be provided.

Using curl command

You can use curl from your Mac or Linux command line.

  1. Choose a sample payload from Samples, and modify if required.
  2. Store it in a file (e.g., request.txt) on your machine.
  3. Run the following command on your command line:
    $ curl -v -X POST --header "Content-Type:application/json" -d @request.txt https://webhook_url