Webhook for Lead Form Extensions in Google Ads in WordPress

First you should create a Google ads search campaign to see Ads & Extensions menu on left.

After that click on,

Ads & Extensions -> Extensions -> Add “Lead Form Extension” (Beta)

Select form fields, fill the empty fields like call-to-action, URL, etc.

You will find a section “Webhook integration (optional)” to enter Webhook URL and Key.

First create a page on your website webhook.php and enter following code in it:

<?php

$Google_data = file_get_contents("php://input");
$decoded_data= json_decode($Google_data, true);

$pass="key_for_webhook";

if ( $pass == $decoded_data["google_key"]){

    $lead_id = $decoded_data["lead_id"];
    
    $campaign_id = $decoded_data["campaign_id"];
    
    $bodyemail .= "Name: " . $decoded_data["user_column_data"][0]["string_value"];
    
    $bodyemail .= "<br>Phone: "  . $decoded_data["user_column_data"][1]["string_value"];
    
    $bodyemail .= "<br>Email: " . $decoded_data["user_column_data"][2]["string_value"];

}

$bodyemail .= "<br>Campagin ID: ". $campaign_id;

$bodyemail .= "<br>lead ID: ". $lead_id;

$emailfrom = "admin@wordpress.com";

$emailto = "your_email@example.com";

$subject = "Google Ads | Lead form extension";

$headers = "MIME-Version: 1.0" . "\r\n";

$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

$headers .= 'From: <webmaster@example.com>' . "\r\n";

$headers .= 'Cc: second_email@example.com' . "\r\n";

mail($emailto, $subject, $bodyemail, $headers);

?>

You can enter your emails where you want to send data, in above code.

Now your Webhook URL is: https://www.your-website-name.com/webhook.php

Your Key is: key_for_webhook

 

At Ziscom Technologies, our webhook for Google Ads lead form extensions reflects over a decade of PHP development experience, serving more than 100 clients worldwide. This solution enables foreign businesses to capture leads from advertisements and deliver them instantly to their systems, enhancing efficiency and effectiveness. Our approach, grounded in extensive project work, ensures this tool meets real-world needs with precision.

The process is straightforward and effective: Google Ads lead forms collect user information—such as names, emails, and phone numbers—directly from ad interactions. Our PHP-based webhook retrieves this data through Google’s API and transfers it seamlessly to your designated endpoint, whether that’s a database, CRM, or custom application. We’ve implemented this for numerous clients globally, enabling immediate lead integration with platforms like HubSpot or tailored solutions (see Customer Relationship Manager CRM). This has consistently reduced lead processing times for businesses we’ve supported, as evidenced by our track record (visit Our Achievements). The code provided above demonstrates the foundation; our expertise ensures its reliability.

We develop this solution securely and efficiently in PHP, managing API connections, endpoints, and data validation with care—protected by SSL encryption. This is not reliant on WordPress plugins but crafted through custom scripting, drawing on our capabilities in Software Development. Should issues arise, our Bug Fixing experience resolves them swiftly, built on years of technical refinement. Payments are processed securely via Hire & Pay, with details outlined in Terms and Conditions. Your data remains protected, as detailed in our Privacy Policy.

This solution is informed by extensive qualifications—our Certifications, including HubSpot, validate our marketing knowledge—while our YouTube channel, Ziscom18, offers tutorials on API integrations and PHP techniques. Our portfolio spans diverse projects, from entertainment platforms (Watch Movies) to e-commerce systems (Sell Your Product Online), making this webhook a natural extension of our skills. For additional resources, explore Free Softwares for tools we recommend.

Interested in implementing this? Contact us at support@ziscom.in through Contact. With over 100 clients served, as highlighted in About, we bring proven PHP expertise to enhance your ad performance. Let us optimize your lead capture today.

Scroll to Top