[Websites]

10 Jul 2024

-

3 min read time

Google Tag Manager for Google Ads and Meta Ads

A practical guide to reliable conversion tracking with GTM, GA4, Google Ads and Meta across React, headless and conventional websites.

Kalle Bertell

By Kalle Bertell

Google Tag Manager for Google Ads and Meta Ads

Reliable advertising starts with a measurement plan

Google Tag Manager can make advertising tags easier to manage, but it cannot decide what a conversion means. Before creating tags, agree on the business actions that Google Ads and Meta should receive.

  • Primary conversions such as purchases, qualified leads and booked calls

  • Supporting actions that are useful for audience building but should not be optimized as sales

  • Conversion value, currency and transaction or lead identifiers

  • The consent required before each destination receives data

  • Who owns changes to the website, GTM container and advertising accounts

Use the same event vocabulary across the website, GA4, Google Ads and Meta. This makes discrepancies easier to investigate and prevents each platform from becoming a separate implementation.

Build a stable data layer

The website should push meaningful events when an action succeeds. For example, purchase should be emitted after the order is accepted, with the transaction ID, value and currency. A lead event should follow a successful form response, not the initial button click.

For React and other single-page applications, include explicit route-change and completion events. DOM-based click triggers are fragile because labels, components and layouts change. Application events are much more dependable.

Set up Google Ads conversions with GTM

  1. Create or select the conversion action in Google Ads.

  2. Copy its conversion ID and conversion label.

  3. Create a Google Ads Conversion Tracking tag in GTM.

  4. Map value, currency and order ID from the data layer when applicable.

  5. Create a trigger based on the successful business event.

  6. Ensure the Conversion Linker is configured.

  7. Preview the container and complete a real test conversion.

  8. Confirm the conversion appears in the platform before relying on it.

Google's conversion measurement guide recommends previewing the change and validating the conversion setup before publishing. For ecommerce, pass a unique order ID so reloads and confirmation-page revisits do not create duplicate transactions.

Connect GA4 without creating duplicates

You may send an important event to GA4 and import it into Google Ads, or configure a dedicated Google Ads conversion tag. Both approaches can work. The mistake is running several versions without understanding which one bidding and reporting use.

  • Choose one primary source for each conversion

  • Keep event names and parameters consistent

  • Document which events are marked as GA4 key events

  • Check whether direct Google Ads tags and imported GA4 events overlap

  • Test cross-domain and payment-provider journeys

  • Compare conversions with CRM or order data

Set up Meta Pixel events

The Meta Pixel can be deployed through GTM using a supported template or controlled custom implementation. Trigger standard events such as ViewContent, Lead, AddToCart and Purchase only when the corresponding action occurs.

For purchases, send value, currency and a stable event or transaction identifier. If both browser and server events are used, configure deduplication so Meta can recognize that they describe the same action.

Map every tag to the appropriate consent category. Test a fresh visit with consent accepted, rejected and changed later. A tag that is blocked on the first page but fires on later navigation is still broken.

  • Confirm default consent state before vendor tags run

  • Check that consent choices persist as intended

  • Verify tags after a visitor changes their selection

  • Test direct landings on deep campaign pages

  • Review whether remarketing and advertising storage behave differently from analytics

Consent requirements depend on the markets and data involved. Engineering should implement the agreed rules, while legal and privacy owners determine those rules.

Handle React and headless websites explicitly

Single-page navigation does not always reload GTM. A robust setup listens for application route changes, sends one virtual page view and avoids repeating initialization tags.

  • Do not count an initial page view twice

  • Preserve campaign parameters through internal navigation where required

  • Trigger conversions from application state, not CSS selectors

  • Test forms that submit without a page reload

  • Check checkout domains and embedded forms

  • Make sure cached pages do not reuse stale transaction data

Validate before publishing

Use GTM Preview, browser network tools and each platform's diagnostic views. Run complete journeys instead of checking that a tag merely loaded.

  • Does the event fire exactly once?

  • Are value, currency, content IDs and transaction IDs correct?

  • Does it fire only after success?

  • Is the event blocked when consent requires it?

  • Does it work on mobile, desktop and client-side navigation?

  • Can the conversion be connected to the correct campaign?

  • Does the backend or CRM contain the corresponding business result?

Common reasons the numbers disagree

  • Different attribution models and reporting windows

  • Duplicate browser and server events

  • Clicks tracked as conversions before a form succeeds

  • Ad blockers and browser restrictions

  • Cross-domain sessions that are not linked correctly

  • Missing or overwritten campaign parameters

  • Consent differences by traffic source or market

  • Test and internal traffic included in production reports

Small differences between systems are normal. Large unexplained gaps should be investigated from the source event through every destination.

When server-side tagging is worth considering

Server-side GTM can move selected processing away from the browser and provide more control over outgoing data. Google documents that moving Ads conversion tags to a server container can reduce code running on the page. It also introduces infrastructure, monitoring and governance work.

Consider it when conversion value is meaningful, browser-only collection is insufficient and the team can maintain the setup. Do not use it as a way to bypass user choices.

Keep the implementation maintainable

Use clear names, folders, environments, version notes and an approval process. Remove old tags rather than pausing them indefinitely. Keep a short tracking specification next to the product documentation so developers and marketers can see what each event means.

If advertising reports cannot be reconciled or every release puts measurement at risk, our Web Performance & Growth Engineering service covers the audit, application events, GTM, GA4, Google Ads, Meta and performance work as one engineering system.

Kalle Bertell

By Kalle Bertell

More from our Blog

Keep reading