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
Trigger: Custom Event - Purchase Attempt
Add a Custom Event trigger onpurchase_attempt, name itCustom Event - Purchase Attemptand Save.Tag: a GA4 Event tag (or Custom HTML - Test)
Add a tag (GA4 Eventpurchase, or the stand-in) firing onCustom Event - Purchase Attempt.Set Tag firing options to Once per page
- In the tag, open Advanced Settings → Tag firing options.
- Choose Once per page, then Save. (Not Once per event: each re-push is a new event, so the tag would still fire twice.)
- For belt-and-braces, capture
transaction_idin 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.
- In your GTM, click Preview.
- Paste the live URL above and click Connect.
- Interact with the live page and watch your tag fire in Tag Assistant.
What you should expect to see
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