Skip to main content
TagManifest /Docs Dashboard

Purchase event on page-load trigger

Purchase event triggered by page-load instead of a custom event trigger, which may fire before ecommerce data is ready.

On this page 6

Summary

  • rule_id — ga4-purchase-wrong-trigger
  • purpose — Detect GA4 purchase event tags firing on page-load or link-click triggers instead of a Custom Event trigger
  • effect — Purchase events may fire before ecommerce data is pushed to the dataLayer, or fire on non-purchase pages
  • layer — container
  • reversibility — non-destructive

What fires this

The rule inspects all GA4 event tags where eventName is purchase (case-insensitive). For each such tag it checks firingTriggerIds against a set of page-load trigger types: PAGEVIEW, DOM_READY, WINDOW_LOADED, LINK_CLICK, and JUST_LINKS. GTM's built-in page-load triggers (All Pages, Initialization, Consent Initialization) count as page-load triggers too. If any purchase tag resolves to one of those trigger types, the tag is flagged. The rule returns one issue per container listing all affected tags and their matched trigger names. Paused tags are excluded because getGA4EventTags filters them upstream.

Why it matters

A purchase event must fire after transaction data lands in the dataLayer. Page-load triggers run before any ecommerce payload is available. The result is a purchase hit with empty or null ecommerce fields, which GA4 records as a conversion with no revenue. On sites with shared confirmation-page templates, the tag can also fire on non-purchase pages that reuse the same URL pattern. Both scenarios corrupt conversion and revenue data in ways that are not always visible in real-time reports. The correct pattern is a Custom Event trigger bound to a dataLayer event like purchase that fires only after the ecommerce object is populated.

Before / after

Tag: "GA4 - Purchase"
  Event name: purchase
  Firing trigger: "All Pages" (type: PAGEVIEW)

Tag fires on every page load.
Ecommerce data not yet in dataLayer.
Tag: "GA4 - Purchase"
  Event name: purchase
  Firing trigger: "CE - purchase" (type: CUSTOM_EVENT)
    Event name matches: purchase

Tag fires only when dataLayer.push({ event: 'purchase', ecommerce: {...} })
is called, ensuring transaction data is present.

Remediation

  1. Open GTM and identify each purchase tag listed in the rule output.
  2. Check the current firing trigger and note its type (PAGEVIEW, DOM_READY, etc.).
  3. Create a Custom Event trigger with event name purchase if one does not exist.
  4. Replace the page-load trigger on the purchase tag with the Custom Event trigger.
  5. Confirm the site's dataLayer implementation pushes { event: 'purchase', ecommerce: { ... } } on transaction completion.
  6. Preview the container, complete a test purchase, and verify the purchase tag fires exactly once with a populated ecommerce object.
  7. Publish the container.

Metadata

Severity
high
Tier
optimization
Category
ga4
Layer
container
Version
1
Effort
15min (about 15 minutes)
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":"ga4-purchase-wrong-trigger","url":"https://example.com"}'