Learn business growth with Google Analytics 4 Forums Google Analytics 4 Troubleshooting Cross-Domain Configuration with GA4 and Google Tag Manager

  • Troubleshooting Cross-Domain Configuration with GA4 and Google Tag Manager

    Posted by Ethan on 5 March 2023 at 7:46 pm

    “Hey folks, I’m having a bit of trouble with Google Analytics 4 after switching my site over. It’s supposed to be easier for cross-domain configuration, but it isn’t playing nice with my URLs. It seems to be refusing to create the gl_ part. I’ve added the domains I need in the admin, and both have the same measurement ID. The Google docs say I might need to manually set up cross-domain, but that’s only for gtag and I’m using Google Tag Manager. Can anyone help me figure out how to do this or what might be messing with my website? Here are my two URLs: https://travelerswithcause.com/home and https://travelerswithcause.app/aplicar.aspx. The “Aplicar Ahora” button is the one that takes you from the first site to the second. Thanks!”

    Ezra replied 1 year, 4 months ago 3 Members · 2 Replies
  • 2 Replies
  • Wyatt

    Member
    1 July 2023 at 2:40 pm

    Hey there! Great job in correctly setting up the GA4 tag and enabling the linking between the domains for GA4. However, it seems that you’re facing an issue because GA4 adds the _gl parameter necessary for cross-domain tracking to link elements. Your “Aplicar Ahora” button isn’t recognized as a link by GA4 because it’s not a link element, which is why you’re not seeing the _gl parameter.

    Good news is that there’s a simple fix for this. If you change the button to an actual link element, GA4 will identify it as such and add the _gl parameter, enabling cross-domain tracking to work seamlessly. Give this a shot!

  • Ezra

    Member
    4 July 2023 at 3:12 pm

    Setting up cross-domain tracking is indeed easier with Google Analytics 4. However, there are a few settings that could influence the behavior you are experiencing. While the GA4 does remove some of the manual setup, certain conditions must still be met for successful automatic setup. For instance, ensure that both URLs are included in the ‘Automatic Link Domains’ list in your GA4 configuration tag in Google Tag Manager (GTM). You should also verify that the measurement IDs are indeed shared between domains. Lastly, enable the ‘Decorate Forms’ configuration on both sides, as it ensures the transfer of client ID when user data is transferred from one domain to another via form submission. If these steps don’t work, consider setting up manual tagging by utilizing a ‘Referrer’ variable in GTM to capture the document.referrer and set that up in the GA4 configuration tag’s ‘Fields to Set’. Even though this seems to go against GA4’s simplified setup, the catch could be lying there. Don’t forget to test your setup using GTM’s preview mode and GA4’s debug view for better error identification.

Log in to reply.