Learn business growth with Google Analytics 4 Forums Google Analytics 4 Modifying GA4 URLs to Exclude Guid in Google Analytics 4 Reply To: Modifying GA4 URLs to Exclude Guid in Google Analytics 4

  • Aiden

    Member
    20 October 2022 at 6:37 pm

    So, you’re switching from Universal Analytics to Google Analytics 4 and got stuck because of the inability to filter URLs like you used to. No worries, we’ve got a few options to tackle this.

    First off, consider removing sensitive information, like a guid, from your URL. This is viewed as a best practice and not only affects GA but any pixel you install. This also has implications for your backend access logs that would contain these IDs. Correcting this would eliminate the need to replace it in analytics.

    Next up, don’t forget Google Tag Manager (GTM) can be a very handy tool here. It can help override the location and path dimensions quite smoothly. You’d do this using three Custom JavaScript (CJS) variables. Two will take the document.location.href, sanitize it according to your needs and return. The third one will process the referrer in a similar way. The only trick here is you’ll have to do this override for every GA4 tag because Google doesn’t allow us to use a config variable like we used to in UA tags.

    Last but not least, there’s the option to replace the data during the Extraction, Transformation, and Load (ETL) process if you’re using another system for analysis. However, this doesn’t take away the sensitive data in GA, which could be a problem depending on your need to sanitize the data.

    Hopefully, one of these options would help you out!