How to Set up Google Analytics 4 (GA4) | GA4 Guide | Varn


18 February 2021

How to Set up Google Analytics 4 (GA4)

In our latest blog in our new GA4 series we looked at the advantages of using GA4 and why it is beneficial to set it up now. So, it only made sense for this next blog to provide you with a simple guide to help you work out the best way to set up a GA4 property for your website.

What’s a GA4 Property?

In Google Analytics, a property refers to a website or app which is linked to a unique tracking code. Therefore, as GA4 has a different style of tracking code to Universal Analytics, we need to set up a new property for GA4. 

This blog will cover setting up a new GA4 property and the various methods of adding GA4 tracking to your site, depending on how your current Universal Analytics tracking is set up, or if this is your first time setting up Google Analytics.

We have also created a handy flow-chart to help you quickly identify the best way for you to implement GA4 tracking. Once you have followed the flowchart below, you can then go directly to the relevant sections of this blog…

How to set up GA4 flowchart

How to set up GA4

  1. If you do not already have any Google Analytics tracking on your website, your first step will be to go to Google Analytics and create a new account and property for your site. Alternatively, if you already have a Universal Analytics property for this site,  navigate to the Admin section and in the Property column, click on ‘GA4 Setup Assistant’. This will set up a parallel GA4 property to run alongside your existing Universal Analytics property.
  2. Once you have set up a new property for GA4, you want to identify the data stream measurement ID. In the Admin section of your new GA4 property, under the Property column, click on ‘Setup Assistant’.
  3. Under the Collection heading, click on ‘Tag installation’ and the Data Streams screen will show. If this is a new property, there will not be any streams here, so you need to click ‘Add Stream’, select Web and follow the instructions. . If one is already there, clicking on it will provide web stream details.
  4. On the Web stream details pop-up, the Measurement ID can be found in the top-right (highlighted in blue in the screenshot below). Copy this ID. You may need it in a later step.
Web stream details screenshot
  1. Here you also have the option to enable or disable Enhanced measurement. We would recommend keeping it enabled. This is also where you have options for how to configure the tagging on your website.
  2. Use the flow chart in our blog to determine which of the following sections is relevant for you and use our instructions to implement GA4 tags on your site.

How to implement GA4 tags on your site

Add the Global Site Tag directly to your site

  1. Under Tagging Instructions, the default tab is Add new on-page tag. If you select Global Site Tag (gtag.js), it will provide code containing your GA4 measurement ID. Copy this code.
  2. Implement this code as the first item in the <head> of every page of the site that you want to measure through Analytics. Alternatively, you might have a CMS that controls the tracking code area of your site, in which case, add this entire code there.
Tagging instructions for GA4

Create a new GTM GA4 tag

The second option on the ‘Add new on-page tag’ tab is to set up Google Tag Manager.

  1. If you don’t already have a Google Tag Manager container for this site, go to the Google Tag Manager page and follow the instructions to set up Google Tag Manager and link it to your site.
  2. If you do already have a GTM container created for this site that controls your existing on-page Google Analytics tag, then you want to follow the instructions under Google Tag Manager in the ‘Use existing on-page tag’  tab. GTM makes it simple to add the new GA4 tracking code to your site.
  3. Open the existing relevant GTM container (you don’t need to create a new one for GA4), navigate to Tags and add a new tag, giving it a sensible name such as ‘GA4 Tracking’.
  4. Then click on Tag Configuration and select the ‘Google Analytics: GA4 Configuration’ tag type.
  5. You then take the Measurement ID that we highlighted earlier, and place this in the corresponding field.
Tag configuration for GA4
  1. Select the All Pages trigger and save the tag.
  2. Submit the changes by publishing the Google Tag Manager container. 

Connect to existing Universal Analytics tags

Alternatively, if you already have Universal Analytics added to your site using the standard gtag.js implementation, you can connect your GA4 tracking to these existing tags so that you do not need to set up any GTM tags or add any additional code to your site.

  1. To add GA4 tracking without changing any code on site, you first need to open your existing Universal Analytics property (must be for the same site) in a new window or tab.
  2. Then navigate to Admin, then Tracking Info and click on Tracking Code in the expanding list.
  3. On this page, below the Global Site Tag section, you will see Connected Site Tags.
Connected site tags screenshots
  1. Clicking on this section will take you to the following screen where you enter the GA4 measurement ID (and a Nickname if you wish) and then click Connect.
Connected Tags for GA4

Check with GA Realtime

Once you have set up your GA4 tracking, you can use the Realtime report to check that it is tracking correctly.

  1. In your GA4 property, click on Real-time in the left-hand sidebar.
  2. In a separate tab or window, open your website.
  3. In the real time report, you should see a new user appear. You can check that it shows a user for your location and displays the correct pages you are looking at. Be aware there might be a slight delay, so you may have to wait a couple of minutes for your user or change of page to display in this report.
  4. You can also use this report to check if any GA4 event tracking is pulling through.
  5. If all of this is showing correctly, then Well Done!! You’ve successfully set up GA4 tracking for your site.
World view GA$

If you’re unsure of the best way to set up GA4 for your site and would like some help from the experts at Varn, please do not hesitate to contact our friendly team. We would love to hear from you.

Article by: Katie, Technical SEO Expert More articles by Katie

Share this article:

( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /home/varnco/public_html/varn2022co/wp-content/themes/varn/page-templates/content-post.php on line 81
Call Stack
10.0002353872{main}( ).../index.php:0
20.0003354152require( '/home/varnco/public_html/varn2022co/wp-blog-header.php' ).../index.php:17
30.937013744904require_once( '/home/varnco/public_html/varn2022co/wp-includes/template-loader.php' ).../wp-blog-header.php:19
40.939513749680include( '/home/varnco/public_html/varn2022co/wp-content/themes/varn/single.php' ).../template-loader.php:106
51.155818457280get_template_part( ).../single.php:2
61.155818457848locate_template( ).../general-template.php:206
71.155818457976load_template( ).../template.php:745
81.156218458648require( '/home/varnco/public_html/varn2022co/wp-content/themes/varn/page-templates/content-post.php' ).../template.php:812

Sign up for the latest SEO insights

Stay up to date with the very latest search marketing insights and news from Varn

Perform Better

Sign Up for Varn Insights
Sign Up for Latest Insights

Keep up to date with the latest search marketing news, insights, algorithm changes and research