For the complete documentation index, see llms.txt. This page is also available as Markdown.

Google Analytics 4

Keep Google Analytics 4 sessions when visitors move to another country storefront.

When Connect Stores sends a visitor from one domain to another (brand.com to brand.ca), Google Analytics 4 can start a new session on the destination. Source, campaign, and ads data often look like a referral from your own store.

Orbe adds GA4’s linker parameter (_gl) to those redirects so the session can continue. You still need cross-domain measurement enabled in GA4.

Keeping UTM parameters in the URL is not the same as keeping the GA4 session. Orbe can preserve the path and UTMs, and the session can still split without _gl.

What Orbe does

On a hostname change, if the origin storefront has GA4 loaded (gtag and a G- measurement ID), Orbe appends _gl before sending the visitor to the other country storefront.

This covers:

  • Geolocation popup, when the visitor continues to another domain

  • Country selector, when the destination is another domain

  • Automatic redirect on a later visit, when the destination is another domain

Orbe does not add _gl when:

  • The visitor stays on the same hostname (for example a Markets subfolder such as /en to /fr)

  • GA4 is not on the page (no gtag, or only Google Ads AW- tags)

  • Decoration fails or times out. The redirect still happens.

There is nothing to enable in Orbe for this. Stores without GA4, or without cross-domain redirects, are unchanged.

Set up GA4

Orbe only stamps _gl on the outbound URL. Session stitching still needs Google’s cross-domain settings on both hostnames.

1

Use the same property

Install the same GA4 property (or linked properties) on every connected country storefront.

2

List both domains

In the Google tag, open Configure your domains (linker settings) and add each hostname, for example brand.com and brand.ca.

3

Confirm linker acceptance

With those domains listed, GA4 accepts incoming linker parameters by default. The destination storefront must load the same Google tag.

4

Exclude self-referrals

The domain list usually stops the origin hostname from counting as a referrer. If .com still appears as the source of .ca traffic, recheck this list first.

Without this GA4 setup, _gl is ignored and sessions still split.

Google’s guide: Set up cross-domain measurement.

How to check

  1. Open a connected storefront that has GA4 loaded.

  2. Use the geolocation popup or country selector to go to another domain.

  3. On the destination URL, look for _gl= (address bar or DevTools → Network).

  4. In GA4 DebugView or Realtime, the destination hit should keep the original session and source, not a referral from your origin hostname.

If _gl is missing:

  • Confirm it was a domain change, not a subfolder on the same hostname.

  • Confirm gtag and a G- ID load on the origin page before the visitor clicks through.

  • If you load GA4 only through GTM, use the custom event below.

Custom GTM setups

Load this script before the visitor is sent to the other storefront (theme custom JS, Orbe custom JS, or GTM). Listening after the click is too late.

The event fires on every Orbe navigation. Native _gl decoration still runs afterward if the hostname changed and _gl is not already on the URL.

Use event.detail.decorate when GTM or another tag needs to change the destination URL asynchronously. Return a URL string.

FAQs

Does Orbe keep UTM parameters?

Yes, when redirect with full path is enabled in Connect Stores settings. That is independent of GA4 sessions.

Why is my .com store showing as the referrer on .ca?

GA4 treated the destination as a new session. Confirm _gl is on the landing URL, then confirm both domains are listed in GA4 cross-domain measurement.

Do I need this for Shopify Markets on one domain?

No. Same-hostname country experiences already share first-party cookies. This only matters when Connect Stores sends visitors to a different hostname.

Last updated

Was this helpful?