Cross-domain tracking keeps one visitor's journey together when it crosses more than one of your domains. This guide covers when a Shopify store needs it, how to set it up in GA4, how pixels handle it, and how to test it.
Key takeaways
Cross-domain tracking joins visits across your domains into one journey, so sales are credited to the right source.
A standard Shopify store does not need it for checkout, which runs on the store's own domain.
You need it for external blogs, landing pages, country domains and headless storefronts.
In GA4, list your domains under Configure your domains and add payment pages to unwanted referrals.
For Meta, TikTok and other pixels, install the same pixel on every domain.
What cross-domain tracking means
Cross-domain tracking follows one visitor as they move between your domains, such as a blog, a landing page and your Shopify store, so analytics sees one journey instead of several unrelated visits.
Analytics tools like Google Analytics 4 recognize visitors with cookies, and each cookie belongs to one domain. Browsers do not share them across domains. So when someone moves from blog.example.com to example-store.com, GA4 starts a new session and may count them as a new user, with your own blog credited as the source.
Cross-domain tracking fixes that by passing an identifier in the link between your domains. Set up properly, it lets you:
- See complete customer journeys across your sites.
- Credit sales to the ad, email or search that started the journey.
- Avoid inflated session and user counts.
- Stop your own domains showing up as referrers.
It builds on a solid conversion pixel setup on your store.
When you need cross-domain tracking in Shopify
Many Shopify stores do not need it at all. You need it when a customer journey crosses more than one domain you control.
Shopify checkout domain
Shopify's checkout now runs on your store's own domain, so a standard Shopify store does not need cross-domain tracking for checkout. If you still see checkout.shopify.com, shop.app or pay.shopify.com as referrers in GA4, for example from Shop Pay, add them to GA4's list of unwanted referrals, as described below.
External blogs or content hubs
If your blog runs on WordPress or another domain, readers who click through to your store start a new session. Cross-domain tracking keeps the blog visit and the purchase in one journey.
International stores or country-specific domains
If you run separate domains for different countries, such as example.co.uk and example.de, and shoppers move between them, link them so the journey stays intact.
Custom apps or portals
Subscription portals, loyalty programs or help centers on their own domain break the journey too. Link them if you want to see how people move between them and your store.
Landing pages and funnels
Landing pages built with ClickFunnels, Unbounce or Webflow often live on another domain. Without cross-domain tracking, a visitor who clicks from the landing page to your store looks like a new visitor referred by your own landing page. That inflates users, splits sessions and credits sales to the wrong source.
Headless storefronts
If your storefront runs on a custom front end, such as Hydrogen on its own domain, check where checkout happens and link the domains if they differ.
How cross-domain tracking works
Cross-domain tracking passes the visitor's identifier from one domain to the next in the link itself.
Example flow:
- A visitor lands on
landing.example.com. - They click a button that goes to
example-store.com. - GA4 adds a
_gl=...parameter to that link. - The store reads the parameter and continues the same session.
GA4 adds the _gl parameter for you once you list the domains, and the parameter is only valid for a couple of minutes, so it cannot be reused later. If you use Google Tag Manager, the same setting applies to your GA4 tag.
Important concepts:
- Linker parameters: the
_glvalue added to links between your domains. - Session continuity: GA4 keeps one session across domains instead of starting a new one.
- Unwanted referrals: domains GA4 should never treat as a traffic source, such as payment pages.
Setting up cross-domain tracking in GA4
GA4 handles cross-domain tracking in its data stream settings.
Step-by-Step setup via Admin:
-
Open your data stream
- In GA4, go to Admin, then Data streams, and click your web stream.
-
Configure your domains
- Click Configure tag settings, then Configure your domains.
- Add each domain in the journey, matching on "contains" or "equals". For example:
example-store.comblog.example.comlanding.example.com
- Save.
-
List unwanted referrals
- Back in Configure tag settings, open List unwanted referrals.
- Add payment and checkout domains that appear as referrers, such as
checkout.shopify.com,shop.appandpay.shopify.com, plus any payment providers like PayPal. - Save.
-
Use the same measurement ID everywhere
- Every domain must send to the same GA4 property. On Shopify, connect GA4 through the Google & YouTube app. On other sites, install the same GA4 tag with the same measurement ID.
GA4 then adds the _gl parameter to links between the domains you listed.
Setting up Meta Pixel for cross-domain tracking
The Meta pixel does not use linker parameters. It relies on its own cookie on each domain, the click ID Meta adds to ad links, and matching against Meta's users, so your job is to install it consistently.
Steps for Meta Pixel tracking:
-
Install the same pixel on every domain
- Use the same pixel ID on your Shopify store and on your blog, landing pages or other sites.
-
Use Shopify's Facebook & Instagram app on the store
- It installs the pixel on product, cart and checkout pages and adds the Conversions API. Our guide to setting up the Facebook pixel on Shopify covers it step by step.
-
Track the same events everywhere
- Use standard events like ViewContent, AddToCart and Purchase with the same names on every site.
-
Verify your domains
- Verify each domain in your Meta business portfolio, so Meta knows they belong to you.
With the pixel installed consistently, Meta attributes conversions to your ads even when visitors move between your sites.
Cross-domain tracking with TikTok and other Pixels
TikTok, Snapchat and Pinterest pixels work much like Meta's: cookie-based, without URL linkers. The same rules apply.
Best practices:
- Install the pixel on all your sites. Same pixel ID everywhere.
- Use standard events. Name events the same way on each site.
- Check with browser extensions. TikTok Pixel Helper or Pinterest Tag Helper show whether each pixel fires.
- Add server-side events where offered. They do not depend on cookies in the browser.
Testing and debugging your setup
Test the whole journey before you rely on the data.
For GA4:
- Look for
_glin the URL. Click from one domain to another. If the destination URL has no_gl=parameter, linking is not working. - Use DebugView or Tag Assistant. Follow your test visit across domains and check it stays one session.
- Check source and medium. If your own domain or a payment page shows up as a referrer, add it to the domain list or unwanted referrals.
For Meta and TikTok Pixels:
- Use Pixel Helper tools. Check the pixel fires on every domain, for example with Meta Pixel Helper.
- Use Test Events. In Meta's and TikTok's Events Manager, watch events arrive as you move between your sites.
- Test on mobile and desktop. Use private windows to act as a new visitor.
SEO & analytics considerations
Keep these points in mind once cross-domain tracking is running.
- Canonical tags: links carrying
_glcreate URLs with parameters. Make sure each page has a canonical tag pointing to the clean URL. Shopify themes add these by default. - Consent: your cookie banner needs to work on every domain, so consent given on one site is respected on the others.
- Redirects: link shorteners, redirect services and some server setups strip URL parameters, which breaks linking. Test links that pass through them.
- UTM parameters: use UTM parameters only on links from outside sources such as ads and emails. UTM tags on links between your own domains start a new session and overwrite the real source.
Common mistakes to avoid
Small mistakes break cross-domain tracking without warning.
Forgetting to include all relevant domains
Every domain in the journey must be in GA4's domain list. Missing one breaks the journey at that point. List every site your customers pass through and check them all.
Using different GA4 measurement IDs across domains
Each domain must send to the same GA4 property. Different measurement IDs mean separate properties, and GA4 cannot link them, even with the _gl parameter.
Failing to enable linking in Google Tag Manager
If you run GA4 through Google Tag Manager, check that your domains are configured in the GA4 data stream and that the GA4 tag in GTM uses the same measurement ID. Otherwise the _gl parameter will not be added.
Stripping or losing URL parameters through redirects
Redirects, link tracking services and some apps drop query parameters, including _gl. Make sure the full URL survives every hop.
Inconsistent or incomplete Pixel placement
If the Meta or TikTok pixel is on your store but not your landing pages, or the other way round, part of the journey goes unrecorded. Install the same pixels everywhere.
Overlooking cookie consent and privacy tools
A consent banner that only runs on your main domain leaves tracking on the other domains either blocked or non-compliant. Use one consent setup across all your sites.
Ignoring mobile and cross-device behavior
Mobile browsers handle cookies and redirects differently, and in-app browsers can drop parameters. Test your cross-domain flows on phones as well as desktop. Journeys that switch device, such as browsing on a phone and buying on a laptop, cannot be linked by cross-domain tracking.
Allowing internal domains to show as referral traffic
Seeing your own domains, or payment pages, as referrers in GA4 is the clearest sign of a broken setup. It credits sales to your own site instead of the ad, email or search that brought the customer. Add them to the domain list or unwanted referrals.
Overcomplicating the setup with redundant tools
Running GA4 through Shopify's app, through Google Tag Manager and through a plugin at the same time counts events twice or three times. Choose one way to install each tool.
Not testing thoroughly before going live
Do not assume it works. Click through the journey, check for _gl in the URL, watch DebugView, and confirm the source stays correct through to purchase.
Set up properly, cross-domain tracking gives you complete journeys and correct attribution, and fewer mismatches between your pixels and Shopify, across your blog, landing pages, store and any other sites you run.
MultiPixels installs GA4, Meta, TikTok, Pinterest and Snapchat pixels on a Shopify store without editing theme code. Install MultiPixels on your Shopify store to run several tracking pixels at once.
