Skip to main content
TagManifest /Docs Dashboard

Ecommerce events on page-load triggers

Detects GA4 ecommerce action event tags (add_to_cart, begin_checkout, etc.) firing on page-load or link-click triggers instead of Custom Event triggers.

On this page 6

Summary

  • rule_id — ecommerce-event-wrong-trigger
  • purpose — Detect GA4 ecommerce action tags firing on page-load or link-click triggers instead of Custom Event triggers
  • effect — Every page view sends a spurious ecommerce event, inflating funnel counts
  • layer — container
  • reversibility — non-destructive

What fires this

The rule calls getGA4EventTags() and filters for tags whose ga4.eventName matches one of eight action events: add_to_cart, remove_from_cart, view_cart, begin_checkout, add_shipping_info, add_payment_info, select_item, or refund. For each matching tag, it checks whether any entry in firingTriggerIds maps to a trigger with type PAGEVIEW, DOM_READY, WINDOW_LOADED, LINK_CLICK, or JUST_LINKS, or is one of GTM's built-in page-load triggers (All Pages, Initialization, Consent Initialization). Tags meeting that condition are flagged. The purchase event is excluded — it is covered by ga4-purchase-wrong-trigger. The page_view event is excluded because it legitimately fires on page load.

Why it matters

Page-load triggers fire on every page load, whether or not the user took any action. An add_to_cart tag on a PAGEVIEW trigger sends that event to GA4 on every page view. Add-to-cart rates appear to be 100%, checkout abandonment becomes unmeasurable, and revenue attribution downstream is unreliable. Ecommerce events should fire when the dataLayer receives the corresponding push — that push happens only when the user actually performs the action. Custom Event triggers wired to dataLayer events are the correct shape.

Before / after

{
  "tag": "GA4 - add_to_cart",
  "ga4EventName": "add_to_cart",
  "firingTriggers": [
    { "name": "All Pages", "type": "PAGEVIEW" }
  ]
}
{
  "tag": "GA4 - add_to_cart",
  "ga4EventName": "add_to_cart",
  "firingTriggers": [
    { "name": "CE - add_to_cart", "type": "CUSTOM_EVENT", "eventName": "add_to_cart" }
  ]
}

Remediation

  1. Open each flagged tag in GTM and note the current trigger assignment.
  2. Identify the dataLayer event name the site pushes when the action occurs (e.g., add_to_cart on button click).
  3. Create a Custom Event trigger with the Event Name matching that dataLayer event.
  4. Remove the page-load trigger from the tag and assign the new Custom Event trigger.
  5. Confirm with the development team that the dataLayer push fires at the correct moment — on the user action, not on page load.
  6. Test in GTM Preview mode: perform the action and verify the event fires exactly once per action.

Metadata

Severity
high
Tier
optimization
Category
ecommerce
Layer
container
Version
1
Effort
2hr (about 2 hours)
Reversibility
non-destructive

See also

Examples

Evaluate
curl https://developer.tagmanifest.com/v1/evaluate-rule \
  -H "Authorization: Bearer $TM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rule_id":"ecommerce-event-wrong-trigger","url":"https://example.com"}'