Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

generate_lead webhooks (Contactform7 & GravityForms)

Alongside your regular tracking, the generate_lead webhooks arriving at your server container can be passed on to n8n, Zapier or Make and used anywhere downstream.

When someone fills in a form on your WordPress site, that submission is worth more than a name and an email address. AdPage also knows where the visitor came from: the campaign, the click ID, the landing page, the session. This guide shows you how to forward all of it from your Google Tag Manager server container to a platform of your choice, so your CRM or automation flow receives the lead and the story behind it.

This only works with Gravity Forms or Contact Form 7 on WordPress. Other CMS platforms aren't supported by this feature.

What gets sent along in the webhook

The lead itself

  • Form fields such as name, email address and phone number

  • The page the conversion happened on, plus a timestamp

  • Behavioural data from the session

The marketing attribution

  • UTM parameters: utm_source, utm_medium, utm_campaign, utm_term, utm_content

  • Click and browser IDs: gclid (Google), fbc / fbp (Meta), ttclid (TikTok)

  • Session data: session ID, session count, user agent

  • Traffic source: referrer URL and landing page

Once the webhook client has done its work, the payload looks roughly like this:

Before you start

Make sure you have:

Step 1: Add the webhook client

The client is what listens for incoming lead data and turns it into the structured payload shown above.

  1. Download the AdPage Webhook client from GitHub.

  2. In your GTM server container, go to Templates, create a new client template, and import the .tpl file you just downloaded.

  3. Go to Clients, create a new client, choose AdPage Webhook Client as the client configuration, and save.

That's it for the client. It parses the incoming request automatically, so there's nothing to configure inside it.

Step 2: Create the HTTP request tag

This tag does the actual sending.

  1. Go to Templates and search the gallery for the JSON HTTP Request tag template. Add it to your workspace.

  1. Create a new tag and select that template as its tag configuration.

  2. Fill in the fields:

Field
Value

URL

Your webhook endpoint (n8n, Zapier or Make)

Request Data

form_data → Event Data variable {{form_data}}

marketing → Event Data variable {{marketing}}

Method (under Additional Options)

POST

Step 3: Add the trigger

The tag needs to fire only when lead data actually comes in.

  1. In the tag configuration, click Triggering and then the blue plus icon at the top right.

  2. Choose Custom as the trigger type, then select Some Events.

  3. Add these two conditions:

    • {{Client Name}} equals AdPage Webhook Client

    • {{Event Name}} equals trytagging_generate_lead

  4. Save the trigger, then save the tag.

Test it with a webhook replay

You don't need to wait for a real form submission. Any webhook that already arrived can be replayed straight into preview mode.

  1. Open your server container in the AdPage platform and go to Webhook Logs.

  2. Find a generate_lead webhook and click the circular double-arrow icon to replay it. A popup asks for a preview header.

  3. To get that header: open the same server container in GTM, switch to Preview mode, click the three dots at the top right and choose Send requests manually.

  4. Copy the x-gtm-server-preview header, paste it into the replay popup, and click Replay

A trytagging_generate_lead request now appears in your preview window and the JSON HTTP Request tag should show as fired. Open the tag and check that form_data and marketing are both populated. If they are, you're done.

When something doesn't work

The tag doesn't fire

Check the trigger conditions first, especially whether the event name matches exactly. Then confirm the client is saved and active in the container.

The tag fires but data is missing

Look at your variable configuration and your data layer implementation. If marketing comes through empty, the attribution data likely isn't being captured on the website side.

The receiving platform rejects the request

Check the webhook URL format, any authentication headers the platform requires, and whether it expects a specific payload structure.

Debugging tips

  • Set the log type to Always log to console while you're testing.

  • Add a trace ID header so you can follow a single request end to end.

  • Start with the basics and add fields once those arrive correctly.

  • Watch for a 200 OK response; anything else is worth investigating.

Keeping it secure

Send only the fields you actually need, and use an HTTPS endpoint. Where your platform supports it, enable webhook signature verification and set proper authentication headers. If the payload contains sensitive personal data, consider encrypting it and restrict who can reach the endpoint.

A few good habits

Configure timeout and retry logic so a temporary outage doesn't cost you leads, validate data before sending it, and set up an alert for failed webhooks. Document your field mappings somewhere your future self can find them, and retest after any change to the form or the container.

Last updated

Was this helpful?