Implementation

POST schema

The POST request sent to webhook will be in JSON format with the following schema:

Webhook Proto payload

// Represent user lead data for single column
message UserLeadColumnData {
  // Deprecated: use column_id instead. To maintain backward compatibility, only
  // populated for predefined fields (e.g.: Full Name).
  optional string column_name = 1;

  // Column value based on column type
  oneof column_value {
    string string_value = 2;
  }
  // Column id. Populated for all types of fields. (e.g.: FULL_NAME)
  optional string column_id = 3;
}

// Message to construct webhook JSON payload
message WebhookLead {
  // Unique id to represent lead
  optional string lead_id = 1;
  // User inputted data per column
  repeated UserLeadColumnData user_column_data = 2;
  // API version
  optional string api_version = 3;
  // Form id to which lead belonged to.
  optional int64 form_id = 4;
  // Campaign id that the lead form is associated with
  optional int64 campaign_id = 5;
  // Key to be used by advertiser to verify the request
  // is from Google.
  optional string google_key = 6;
  // Denotes if the lead is a test lead.
  optional bool is_test = 7;
  // GCL id for the lead submission.
  optional string gcl_id = 8;
  // Adgroup id which generated the lead.
  optional int64 adgroup_id = 9;
  // Creative id which generated the lead.
  optional int64 creative_id = 10;
}

Field description

Field Description
lead_id Unique string which identifies a given lead.

Handling recommendation: Use this to dedupe leads which are received. This will be unique across all forms. When reporting issues related to a specific lead, this id will be required.

api_version API version which this lead schema belongs to. This will be used when migrating to a new schema, and can be ignored for now.
form_id Unique ID for each form configured in Google Ads. Current product allows attaching a form with a campaign level (vs. attaching at ad group or ad levels).

Implications: Leads can be sliced only at form_id level (i.e., at campaign level).

Clients need to use 8 bytes integer to process.

campaign_id The Google Ads campaign ID or line item ID (Display & Video 360) of the attached lead form.

Clients need to use an 8-byte integer to process.

adgroup_id The Google Ads ad group ID is used to distinguish the specific ad group in the campaign. (Available for leads from video and discovery ads only)

Clients need to use an 8-byte integer to process.

creative_id The Google Ads creative ID is used to distinguish the specific creative in the ad group. (Available for leads from video and discovery ads only)

Clients need to use an 8-byte integer to process.

gcl_id Google click ID, a unique parameter used to track each click of an ad.
google_key A key configured by the advertiser with each form.

Handling recommendation: Before processing a lead received over webhook, validating google_key is the same as configuring in Google Ads in order to have more confidence that the lead is valid. Keep this key confidential and update in Google Ads if there is a reason to believe that this has leaked widely.

is_test This field has "optional" semantic. If value is true, treat this lead as test lead. If value is false or if field is not present, treat this lead as valid production lead.
user_column_data A repeated key-value tuple transmitting user submitted data.
  • user_column_data.column_name: Data type submitted by the user. This field has been deprecated, use column_id instead.
  • User_column_data.column_value: For each data type, there will be a value type populated depending on data type. All our current data types have the value of user_column_data.string_value.
  • user_column_data.column_id: Data type submitted by the user.
user_column_data.column_name User_column_data.string_value content user_column_data.column_id
"Full Name" User full name. "FULL_NAME"
"First Name" User first name. "FIRST_NAME"
"Last Name" User last name. "LAST_NAME"
"User Email" User email. "EMAIL"
"User Phone" User Phone in E.164 format, e.g., "+11234567890". "PHONE_NUMBER"
"Postal Code" Postal code of user. "POSTAL_CODE"
"Company Name" Company name of user. "COMPANY_NAME"
"Job Title" Job title of user. "JOB_TITLE"
"Work Email" Work email of user. "WORK_EMAIL"
"Work Phone" Work phone of user. "WORK_PHONE"
"Street Address" Street address of user. "STREET_ADDRESS"
"City" City of user. "CITY"
"Region" Region of user. "REGION"
"Country" Country of user. "COUNTRY"
N/A Which model are you interested in? "VEHICLE_MODEL"
N/A Which type of vehicle are you interested in? "VEHICLE_TYPE"
N/A Select your preferred dealership "PREFERRED_DEALERSHIP"
N/A When do you plan on purchasing a vehicle? "VEHICLE_PURCHASE_TIMELINE"
N/A What type of vehicle condition are you interested in? "VEHICLE_CONDITION"
N/A Do you own a vehicle? "VEHICLE_OWNERSHIPVEHICLE_PAYMENT_TYPE"
N/A What vehicle ownership option are you interested in? "VEHICLE_PAYMENT_TYPE"
N/A What size is your company? "COMPANY_SIZE"
N/A What is your annual sales volume? "ANNUAL_SALES"
N/A How many years have you been in business? "YEARS_IN_BUSINESS"
N/A What is your job department? "JOB_DEPARTMENT"
N/A What is your job role? "JOB_ROLE"
N/A Which program are you interested in? "EDUCATION_PROGRAM"
N/A Which course are you interested in? "EDUCATION_COURSE"
N/A Which product are you interested in? "PRODUCT"
N/A Which service are you interested in? "SERVICE"
N/A Which offer are you interested in? "OFFER"
N/A Which category are you interested in? "CATEGORY"
N/A Select your preferred method of contact "PREFERRED_CONTACT_METHOD"
N/A Select your preferred location "PREFERRED_LOCATION"
N/A What is the best time to contact you? "PREFERRED_CONTACT_TIME"
N/A When are you looking to make a purchase? "PURCHASE_TIMELINE"
N/A How many years of work experience do you have? "YEARS_OF_EXPERIENCE"
N/A What industry do you work in? "JOB_INDUSTRY"
N/A What is your highest level of education? "LEVEL_OF_EDUCATION"
N/A What type of property are you looking for? "PROPERTY_TYPE"
N/A What do you need a realtor's help with? "REALTOR_HELP_GOAL"
N/A What community are you interested in? "PROPERTY_COMMUNITY"
N/A What price range are you looking for? "PRICE_RANGE"
N/A How many bedrooms are you looking for? "NUMBER_OF_BEDROOMS"
N/A Are you looking for a fully furnished property? "FURNISHED_PROPERTY"
N/A Are you looking for properties that allow pets? "PETS_ALLOWED_PROPERTY"
N/A What is the next product you plan to purchase? "NEXT_PLANNED_PURCHASE"
N/A Would you like to sign up for an event? "EVENT_SIGNUP_INTEREST"
N/A Where are you interested in shopping? "PREFERRED_SHOPPING_PLACES"
N/A What is your favorite brand? "FAVORITE_BRAND"
N/A Which type of valid commercial license do you have? "TRANSPORTATION_COMMERCIAL_LICENSE_TYPE"
N/A Are you interested in booking an event? "EVENT_BOOKING_INTEREST"
N/A What is your destination country? "DESTINATION_COUNTRY"
N/A What is your destination city? "DESTINATION_CITY"
N/A What is your departure country? "DEPARTURE_COUNTRY"
N/A What is your departure city? "DEPARTURE_CITY"
N/A What is your departure date? "DEPARTURE_DATE"
N/A What is your return date? "RETURN_DATE"
N/A How many people are you traveling with? "NUMBER_OF_TRAVELERS"
N/A What is your travel budget? "TRAVEL_BUDGET"
N/A Where do you want to stay during your travel? "TRAVEL_ACCOMMODATION"

Lead handling

Lead handlers should respond with the following HTTP codes:

HTTP Response Response body (JSON) Retriable error?
200 {} N/A
4XX {"message: Free form error text, describing what was wrong with request"} No
5XX {"message: Intermittent retraible error optional message"} Yes

Duplicates

A single lead is not guaranteed to be delivered exactly once, hence lead handling webhook should handle duplicates gracefully.