SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Missing GA4 Purchase Attribution Parameters via Segment

Issue

When you send purchase events from a checkout domain to a Google Analytics 4 (GA4) Web destination via Segment, your attribution parameters (such as UTM values, gclid, fbclid, source, or medium) are missing. As a result, your conversions and purchase events are not tied back to your original marketing channels like Meta, Google, or direct traffic.

 

Product

Twilio Segment

 

Cause

Segment's GA4 Web destination loads gtag.js natively in the browser, which reads attribution data directly from the current page URL. If your users are redirected to a separate checkout domain that does not retain the original UTM parameters or tracking query strings in its URL, Segment cannot extract or forward this context. Consequently, the context.campaign object is absent from your event payload and context.page.url lacks the necessary tracking parameters at the exact moment of purchase.

 

Resolution

To ensure your attribution data is captured at checkout, implement one of the following three options:

  • Option 1: Pass UTM Parameters in the URL Redirect (Recommended) Configure your primary site to forward all original UTM parameters and click identifiers as query strings when redirecting the user to your checkout domain. Segment will automatically detect these parameters from the checkout URL and include them in the purchase payload.

  • Option 2: Configure GA4 Cross-Domain Measurement Set up cross-domain tracking within your Google Analytics 4 property admin settings to stitch user sessions seamlessly between your primary domain and your checkout domain. This allows Google to persist the original session attribution across the domain change.

  • Option 3: Store and Re-apply Parameters Client-Side If URL persistence or GA4 cross-domain configuration is not feasible, use client-side storage (such as cookies or local storage) to save the UTM parameters upon the user's initial landing. Retrieve and manually re-apply these parameters to the Segment event context payload at the time of the purchase event.

 

Additional Information

For more details on how Segment automatically handles campaign tracking parameters, please refer to the public documentation on Segment tracking for UTM parameters.

Have more questions? Submit a request
Powered by Zendesk