Learn business growth with Google Analytics 4 Forums Google Analytics 4 Implementing Custom URLs in GA4 via Google Tag Manager

  • Implementing Custom URLs in GA4 via Google Tag Manager

    Posted by Emily on 7 February 2023 at 6:11 pm

    Hey, do you know how in universal analytics we could send a custom URL to set in section fields? Well, how can we do that for Google Analytics 4 using Google Tag Manager?

    Anthony replied 10 months, 3 weeks ago 3 Members · 2 Replies
  • 2 Replies
  • Gabriel

    Member
    23 May 2023 at 12:01 pm

    No worried at all! It’s pretty simple to do this. Just like Universal Analytics, Google Analytics 4 (or GA4) also allows you to set fields in Google Tag Manager. In the configuration tag for GA4, you’d see a familiar option “Fields to Set”. It’s totally the same process – you just pick the parameter name that you have in mind (either a unique one or a set name that Google already uses), then just pass your variable in as the value.

    The only extra step you have to take here is to create a custom parameter. But hey, it’s not rocket science. Go into the Configuration menu in GA4, and you’ll find the option to create the custom parameter. Once you’ve done that, you’re all set! Your created parameter can now be utilized in your reports. Easy peasy, right?

  • Anthony

    Member
    28 May 2023 at 10:35 am

    In Google Analytics 4 (GA4), you can send a custom URL using Google Tag Manager (GTM) by utilizing its advanced tracking capabilities to customize predefined and custom parameters in an event.

    First, you need to implement GA4 in GTM. Then you can start sending the custom URL by creating a new GA4 configuration tag in GTM and setting your desired GA4 Measurement ID. Once you have the GA4 configuration tag set to fire on all pages, you can start customizing events with parameters.

    For example, the page_view event automatically sends the URL. If you want to modify this URL or send a custom one, you can create a new variable for it in GTM, then in the event parameters section of the GA4 configuration tag, you will put the parameter name (like page_location which is the default parameter for URL in GA4) and then, in the value, you would assign the custom variable you created.

    In addition to this, you can also make use of ‘Fields to Set’ option where you can mention field name and its value which will get reflected in all hits sent from this tag. You should keep in mind that GA4 focuses more on the concept of ‘Events and Parameters’ instead of the traditional ‘Users and Sessions’ approach that was used in the universal analytics.

    However, please note that modifying the page_location parameter will not change the URL recorded in GA4, this needs to be done on your website configuration to reflect the changes on GA4. The method suggested above is to send additional or custom data along with your events to GA4.

Log in to reply.