The reliable way to do Unbounce conversion tracking for Google Ads is to install Google Tag Manager through Unbounce Script Manager, push a custom ub_form_success event from Unbounce's window.ub.hooks.afterFormSubmit hook, and fire your Google Ads, GA4 and Meta tags from a Custom Event trigger on that name. GTM's built-in Form Submission trigger does not work on Unbounce forms, and mixing it with the custom event is the most common cause of double counting.
This is for agency owners, PPC managers and developers who run paid traffic to Unbounce Classic Builder pages. It covers where the GTM snippet actually lands, the confirmation dialog versus a redirect, the hook code with a fix for redirects that cut tags off, button and link goals, gclid and UTM hidden fields for the CRM, Smart Traffic variants, popups and sticky bars, cross-domain cases, and every way the same lead gets counted twice.
How do you add Google Tag Manager to Unbounce?
You have two options, and you should pick one per domain, not both.
- Script Manager integration. Go to Settings, then Script Manager, click Add a Script, choose Google Tag Manager from the drop-down and paste the container ID (the
GTM-XXXXXXX value). Select the domains in Script Usage, then Save and Publish Script. Republish the pages for it to take effect.
- Manual install per variant. In the Classic Builder, open Javascripts at the bottom of the builder, add the first GTM snippet with Placement set to Head, then add the second (noscript) snippet with Placement set to After Body Tag. Repeat for every variant and republish.
A few details that matter in practice:
- Script Manager needs a custom domain. It does not work on the
unbouncepages.com test domain. If a client is still running ads to that domain, install manually or move the page first.
- Placement is fixed for the integration. Unbounce documents that GTM added through Script Manager goes into the After Body Tag placement and is included on all parts of the page, which means the main page and the form confirmation dialog.
- Load order. Script Manager scripts load after variant level scripts. Anything you add in the builder that pushes to the data layer must not assume GTM has already loaded, so always start with
window.dataLayer = window.dataLayer || [];.
- Cookie banner. If you use the Unbounce Cookie Consent Banner, Unbounce's instruction is to put both GTM snippets in a single script with Placement set to After Body Tag so the banner loads first.
- Builder support. The Script Manager GTM integration only works for Classic Builder pages. Smart Builder has its own GTM app, and the newer AI Hybrid Builder has separate tracking docs. Everything below assumes Classic Builder, which is still what most agency accounts run.
The biggest install mistake is having GTM in both places. Unbounce warns that a script on the page and in Script Manager runs twice, which means two of every conversion. Before you turn on the integration, delete old GTM, gtag and Pixel code from each page's Javascripts panel.
Why the GTM Form Submission trigger does not work on Unbounce
Unbounce submits its forms with its own JavaScript, so the standard browser submit event GTM listens for is not something you can rely on. Unbounce's documentation states it plainly: the GTM Form Submission trigger does not capture Unbounce form submissions, and you need a Custom Event trigger instead.
Click triggers on the submit button are no better. They fire on failed validation too, so you record attempts, not leads. The GTM form tracking guide covers that problem in general.
Unbounce conversion tracking for Google Ads with the afterFormSubmit hook
Unbounce exposes two form hooks on Classic Builder pages. beforeFormSubmit runs after validation passes but before the lead is recorded. afterFormSubmit runs after the lead is recorded. Each hook function receives an object with formElement (the form's DOM element) and isConversionGoal (whether the form is set as a conversion goal). Both hooks accept a function that returns a promise, and the submission waits for it to finish. Unbounce labels these as community code that its support team will not troubleshoot, so test on a published page. The details are in Unbounce's article on running custom scripts on form submission.
Unbounce's own GTM article gives the minimal version, added through Javascripts with Placement set to Before Body End Tag:
<script>
window.ub.hooks.afterFormSubmit.push(function() {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'ub_form_success'
});
});
</script>
That works when the form shows the confirmation dialog. It has a gap when the form redirects. The browser starts leaving the page as soon as the hook returns, and a Google Ads or Meta request that has not finished yet gets cancelled. Because the hook waits on a promise, you can hold the redirect until GTM reports its tags are done, with a hard timeout so a blocked GTM never traps the visitor:
<script>
window.ub.hooks.afterFormSubmit.push(function (args) {
return new Promise(function (resolve) {
var finished = false;
function finish() {
if (!finished) { finished = true; resolve(); }
}
var form = args.formElement;
var emailField = form.querySelector('#email');
var idField = form.querySelector('#event_id');
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'ub_form_success',
ub_page_id: window.ub.page.id,
ub_page_name: window.ub.page.name,
ub_variant: window.ub.page.variantId,
ub_is_goal: args.isConversionGoal,
lead_event_id: idField ? idField.value : '',
lead_email: emailField ? emailField.value : '',
eventCallback: finish,
eventTimeout: 2000
});
setTimeout(finish, 2500);
});
});
</script>
Notes on that code:
- Field IDs.
#email and #event_id assume your form fields use those field IDs. Unbounce inputs take the field ID as their DOM id, which is why Unbounce's own examples use selectors like input#name. Check yours in the form editor.
- Page variables.
window.ub.page.id, window.ub.page.name and window.ub.page.variantId are documented Unbounce page variables. Map them to Data Layer Variables in GTM.
- Email. Only push the email if you use it for Google Ads enhanced conversions or Meta advanced matching, and only send it to those tags. Never put it in a GA4 parameter. Setup is in the enhanced conversions guide.
- Timeout. Keep it short. Unbounce warns that slow hooks cost leads.
In GTM, create a trigger with Trigger Type Custom Event, Event Name ub_form_success, and regex matching left off. Then attach it to:
- Google Ads. A Google Ads Conversion Tracking tag with your conversion ID and label. Add a Conversion Linker tag on All Pages so the click ID is stored in first party cookies.
- GA4. A GA4 Event tag named
generate_lead with the page and variant parameters. Mark it as a key event in GA4.
- Meta. A Custom HTML tag that calls the standard
Lead event with an event ID, covered below.
Form confirmation dialog vs Go to URL: which is better for tracking?
In the form's Properties panel, the Form Confirmation section lets you choose Show form confirmation dialog or Go to URL. Both work with the hook approach. They behave differently for everything else.
| Option | How it tracks | Watch out for |
| Show form confirmation dialog | Hook event on the main page. The dialog is its own document with its own Javascripts panel, and Script Manager can include scripts on it. | If GTM loads on both main page and dialog, a GA4 page view fires for the dialog too. Page load conversions placed in the dialog duplicate the hook event. |
| Go to URL (Unbounce page) | Hook event before the redirect, using the promise version above. | Thank you page reloads, bookmarks and back button visits fire page load tags again. |
| Go to URL (main website) | Hook event before the redirect. The thank you page can carry its own tags. | Cookie and session continuity depend on the domains. See the cross-domain section. |
Unbounce's Google Ads article describes the older method: Google tag on the main page and the Google tag plus event snippet on the confirmation dialog or a thank you page, or in Script Manager with Included on set to the form confirmation page. It works, but it is a page load conversion. Do not run it alongside the hook event. Pick one.
If you use Go to URL, there is also an Append form data to URL checkbox, meant for passing values to the next page. Be careful with it. It puts form values, including email and phone, in the query string, and from there into GA4 page location, Google Ads and every analytics tool on the thank you page. Sending personal data to GA4 in URLs breaks Google's policies. Only append fields that are not personal data, or drop the option and pass what you need another way.
What about multi-step forms and validation failures?
Because beforeFormSubmit runs only after validation passes and afterFormSubmit runs only after the lead is recorded, failed validation never fires your event. That is the main advantage over click triggers.
Multi-step forms on Unbounce are usually one form split into steps with a script. Only the final submit records a lead, so only the final submit fires the hook. For step reporting in GA4, push a separate event like ub_form_step and keep it off the ad platform tags.
Repeat submissions are a different story. If the same visitor submits twice, Unbounce records two leads and the hook fires twice. Unbounce's own conversion count shows one, because it counts once per visitor. In Google Ads, set the lead conversion action's Count setting to One so repeat submits from the same click do not inflate it.
How to track button clicks and external links on Unbounce
Classic Builder conversion goals can be links, button links or forms. You tick them in the Goals tab under Conversion Goals. Those goals only feed Unbounce's own reports, and all selected goals roll into one conversion number. Unbounce also counts multiple goal clicks from the same browser once.
For ad platforms, use GTM. Unbounce buttons are links, so a Just Links trigger is a good fit:
- Outbound or booking links. Trigger Type Just Links, with Click URL contains the destination domain. Turn on Wait for Tags with a short max wait so the tag fires before navigation.
- Click to call. Click URL starts with
tel:. This counts taps, not calls. Unbounce says the same about tel goals: a click is not a completed call.
- Specific buttons. Use Click ID. Classic Builder elements have IDs like
lp-pom-button-12, which you can find in the builder or in DevTools. Those IDs can change when you duplicate a variant, so check them on every variant.
How do you pass gclid and UTMs from Unbounce to the CRM?
Unbounce forms only submit what is in a field. To carry campaign data, add hidden fields in the form editor whose field IDs match the URL parameters exactly. Unbounce is strict here: field IDs are case-sensitive and the default value must be left blank. The documented setup is in Unbounce's guide to passing URL parameters through a form. The usual set:
- Google Ads click IDs.
gclid, plus gbraid and wbraid, which Google Ads uses on some iOS and app traffic instead of a gclid.
- Meta click ID.
fbclid, useful for building the fbc value for the Conversions API.
- UTMs.
utm_source, utm_medium, utm_campaign, utm_term, utm_content.
- Dedup ID.
event_id, filled by script, used for Meta deduplication.
The catch: hidden fields only fill from the URL of the page the visitor is on. If someone lands from an ad, clicks to another page and comes back, or the page strips parameters, the field is empty. With a Conversion Linker tag on the page, the click ID is also stored in the _gcl_aw cookie. This fallback reads it when the hidden field is empty:
<script>
window.ub.hooks.beforeFormSubmit.push(function (args) {
var field = args.formElement.querySelector('#gclid');
if (!field || field.value) { return; }
var match = document.cookie.match(/(?:^|; )_gcl_aw=([^;]+)/);
if (match) {
var parts = decodeURIComponent(match[1]).split('.');
field.value = parts.slice(2).join('.');
}
});
</script>
The cookie value looks like GCL. plus a timestamp plus the gclid, so the script keeps everything after the second dot. It only works after consent allows ad storage, and only if the Conversion Linker ran before the form was submitted.
From there, the lead reaches the CRM through Unbounce's native integrations, Zapier, or the webhook. The webhook posts form fields along with page_url, page_name, page_uuid and variant. In the data.json payload each value is an array, so read the first element: gclid[0], not gclid. Your endpoint must return a 200 or Unbounce treats the post as failed. Once the gclid is in the CRM, you can import qualified leads and sales back to Google Ads, which is what our offline conversion import guide walks through.
Meta Pixel Lead event and Conversions API deduplication on Unbounce
Generate one ID per submission, put it in the hidden field so it reaches the CRM or webhook, and send the same ID with the browser event. Do it in beforeFormSubmit so it only runs for valid submissions:
<script>
window.ub.hooks.beforeFormSubmit.push(function (args) {
var field = args.formElement.querySelector('#event_id');
if (field && !field.value) {
field.value = 'ub.' + Date.now() + '.' + Math.random().toString(36).slice(2, 10);
}
});
</script>
The afterFormSubmit hook shown earlier already pushes it as lead_event_id. In GTM, a Custom HTML tag on the ub_form_success trigger sends the Pixel event:
<script>
fbq('track', 'Lead', {}, { eventID: {{DLV - lead_event_id}} });
</script>
Your server sends the Conversions API Lead event with event_id set to the same value from the webhook payload, and the same event name. Meta then keeps one of the two. If the IDs or names differ, you get two leads. The Meta deduplication guide has the full checklist.
Smart Traffic, A/B variants and how to report them
All variants of an Unbounce page share one URL, so your ad platforms cannot tell them apart. Send the variant letter with every event instead. The hook above pushes window.ub.page.variantId as ub_variant. Register it as an event-scoped custom dimension in GA4 and you can compare variants against real downstream lead quality, not just form fills.
Two Smart Traffic specifics:
- It optimizes on Unbounce goals. Smart Traffic uses the conversion goal set in the builder, such as a form submission. Keep that goal ticked even though GTM handles the ad platforms. Unbounce's numbers and your GTM numbers measure different things and will not match exactly. That is not double counting.
- Variants need the same tracking. Variant level scripts live on each variant. If the hook script is on variant A but not B, B's leads never reach Google Ads and Smart Traffic will happily send it more traffic. Putting the hook in Script Manager avoids this, as long as it is not also on the variants.
Tracking Unbounce popups and sticky bars
Popups and sticky bars are separate Unbounce assets with their own embed code and their own forms. They are installed on a website, or on a Classic Builder page through the Javascripts panel with Placement set to Head. Unbounce notes that only one embed code per client loads on a page.
The documented tracking option is in the popup or sticky bar Overview, under Google Analytics: a toggle called Fire Google Analytics events when this is shown, and when visitors convert. With GA4 on the host site, it sends unbounce_popup_view, unbounce_popup_conversion, unbounce_sticky_bar_view and unbounce_sticky_bar_conversion, with an event_label parameter you can customize.
For Google Ads, the simplest verified path is to mark unbounce_popup_conversion as a key event and import it, or send the popup form to a thank you URL you control and fire tags there. Do not do both, and do not also build a GTM tag for the same popup, or each signup counts twice.
Cross-domain: Unbounce subdomain to the main site
Most agency setups put Unbounce on a subdomain, like go.client.com, with the main site on www.client.com. Google tags set their cookies on the root domain by default, so GA4 and the Conversion Linker share _ga and _gcl_aw across both. No cross-domain linking is needed. Unbounce's external conversion tracking relies on the same rule: the landing page and confirmation page must share a root domain.
You need linking when the domains differ, for example the Unbounce page on clientoffers.com and checkout on client.com. Then:
- GA4. Add both domains under Configure your domains in the GA4 data stream's tag settings, and add both to the unwanted referrals list. Details are in our cross-domain and self-referral guide.
- Google Ads. In the Conversion Linker tag, turn on Enable linking across domains and list the other domain in Auto Link Domains. If a form posts across domains, Decorate Forms is available. See Google's Conversion Linker documentation.
Why is Unbounce double counting conversions?
When Google Ads shows roughly twice the leads that exist in the CRM, check these in order:
- Form Submission trigger plus custom event. Unbounce warns that having GTM's built-in Form Submission trigger in the same container as the
ub_form_success trigger causes duplicate events, even if the default trigger has no tags. Delete it, or use a separate container for Unbounce pages.
- GTM installed twice. Script Manager plus a variant level snippet. In Tag Assistant you will see two container loads.
- Page load conversion plus hook event. An event snippet on the confirmation dialog or thank you page, plus a GTM tag on
ub_form_success.
- Unbounce GA4 integration plus GTM GA4. Unbounce's built-in GA4 integration sends its own events, including form submissions under an event named
event with an eventAction parameter. If you also send generate_lead from GTM and mark both as key events, GA4 counts two. Use one or the other.
- Imported GA4 key event plus Google Ads tag. Both set as primary conversion actions for the same lead. Keep one primary. Our fix for Google Ads counting conversions twice covers this.
- Count set to Every. For leads, Count should be One.
Unbounce's own conversion goals are not on this list. They stay inside Unbounce.
How to test Unbounce conversion tracking before launch
- Publish first. Hooks and Script Manager only run on the published page on your custom domain, not the builder preview.
- Open GTM Preview with the live URL plus
?gclid=test123&utm_source=google&utm_medium=cpc. Confirm one container loads.
- Submit with a bad email. No
ub_form_success should appear.
- Submit correctly. Exactly one
ub_form_success, with ub_variant and lead_event_id filled. Your Google Ads, GA4 and Meta tags fire once each.
- Repeat on a redirect form. Check the Network panel for the Google Ads and Meta requests before the page changes.
- Check the lead. In the Unbounce Leads table and in the CRM or webhook log, confirm
gclid, UTMs and event_id arrived.
- Check each variant by forcing it in a fresh session, and check Meta Events Manager Test Events for a deduplicated
Lead.
Getting it fixed for a client
Unbounce tracking usually breaks in quiet ways: a variant without the hook, an old event snippet left in a dialog, a gclid field named GCLID, or a Form Submission trigger nobody remembers adding. Each one skews bidding without any error showing up. If you want a second set of eyes on a client account before the next budget increase, request a free tracking check and we will tell you what is firing, what is duplicated and what is missing.