Don't have one? Create one ↗
← All courses
Lessons in this module

Lesson 9 of 11

Tag Firing Options & Dedup

① Connect your GTM container

Paste your container ID to load it into this page. It only ever runs here.

Advanced: use a specific environment

Double-firing is one of the most expensive bugs in analytics: a conversion counted twice inflates revenue, ruins ROAS and can double-bill an ad platform. It usually comes from the same event landing in the dataLayer more than once, a framework re-render, a listener bound twice, a retried request.

The fix people reach for first, Once per event, doesn't help here: each re-push is a new dataLayer event, so the tag happily fires again. Once per event only protects you when one event matches two of the same tag's triggers. What works is Once per page (the tag fires at most once per page load), or true idempotency: gate on a unique key like transaction_id so the same id never counts twice, and send it to GA4, which deduplicates purchases by transaction_id in reporting.

The button below fires purchase_attempt twice for one click. Wire a conversion tag and make it record a single conversion.

Goal

Make a tag fire only once even when the same event is pushed twice.

Build it in GTM

  1. Trigger: Custom Event - Purchase Attempt

    Add a Custom Event trigger on purchase_attempt, name it Custom Event - Purchase Attempt and Save.
  2. Tag: a GA4 Event tag (or Custom HTML - Test)

    Add a tag (GA4 Event purchase, or the stand-in) firing on Custom Event - Purchase Attempt.
  3. Set Tag firing options to Once per page

    1. In the tag, open Advanced Settings → Tag firing options.
    2. Choose Once per page, then Save. (Not Once per event: each re-push is a new event, so the tag would still fire twice.)
    3. For belt-and-braces, capture transaction_id in a Data Layer Variable and send it on the GA4 tag, GA4 deduplicates purchases with the same id in reporting.

Debug in Tag Assistant

Copy this lesson's live URL and paste it into GTM Preview, that is the page Tag Assistant connects to. It has the clickable elements, so this page stays clean for reading.

  1. In your GTM, click Preview.
  2. Paste the live URL above and click Connect.
  3. Interact with the live page and watch your tag fire in Tag Assistant.

What you should expect to see

The timeline shows purchase_attempt twice, but under Tags Fired your conversion tag appears once.

Verify your container

Built it? Export your container, Admin → Export Container, choose your workspace, then drop the JSON here to check it against this lesson.

Drop your container .json here

or browse · checked in your browser, nothing is uploaded

0 of 11 lessons complete
Was this lesson helpful?