A Step-By-Step Guide to Implementing Google Analytics 4 with GTM
Google Analytics 4 is the innovative next generation web analytics platform from Google. GA4 has been created using the power of machine learning to automatically alert you to new trends in user behaviour. In addition, the old interface of ‘Audience’, ‘Acquisition’, ‘Behaviour’, and ‘Conversion’ has been replaced by ‘Life Cycle’, ‘User’, ‘Events’, ‘Explore’, and ‘Configure’.
Although Google Analytics 4 has many new and powerful features, it does lacks some of the valuable resources which makes Universal Analytics (UA) so useful when exploring user behaviour data. This may explain why Google advises that you should run Google Analytics 4 alongside your your existing GA implementation.
For this reason, I’m going to show you how to upgrade to Google Analytics 4 without losing your existing Universal Analytics (UA) property. But first, what are the main differences between Google Analytics 4 and Universal Analytics?
What’s Different about Google Analytics 4?
Google Analytics is an event driven model which you may have seen in Firebase. That’s because it has Firebase on the backend. An event driven model gives GA4 much greater flexibility than UA which is based on pageviews and sessions.
With UA you need to manually configure events and so unless you actively create tags you would have no visibility of what users do on your website, other than the pages they visited. GA4 automatically measures certain types of events and has other types of events that you can easily enable, or you are recommended to configure. GA4 events are grouped into four categories:
Google Analytics 4 Events:
- Automatically Collected Events – Basic user interactions tracked on your site.
- Enhanced Measurement – When you enable enhanced measurement in GA4 the platform will automatically track interactions like link clinks, scrolling, and YouTube video plays.
- Recommended Events – These events need to be implemented manually but use predefined names and parameters. These are grouped into individual sectors such as Retail/eCommerce and Jobs/Education/Real Estate and Games.
- Custom Events – As with Universal Analytics you can create your own custom events.
Google documents more details of these differences between GA4 and Universal Analytics here.
Other Features of GA4:
- GA4 has a more flexible data model as you are no longer restricted to the rigid event structure of category, action and label. Instead, GA4 uses parameters to allow you to create your own naming conventions. This does, however, mean you need to plan your events in advance to provide consistency and logic to your event structure.
- Machine learning enables GA4 to use modelling which can extrapolate from incomplete data sets to power a new AI Insights feature. This automatically seeks out useful insights to inform marketers about users on the website or app.
- Predictive audiences in GA4 allow you to create remarketing and re-engagement campaigns based upon the probability of users to purchase or churn. This is based upon the machine learning engine in GA4.
- It is designed for a cross-platform world so that you can stream data from apps and websites into the same GA property.
- GA4 integrates directly with BigQuery. Previously this was only available with GA 360, but now it’s free with GA4.
- The Analysis Hub offers new reports such as funnel analysis visualisation and path analysis that were previously only available in GA 360. The funnel analysis report is especially powerful. Unlike GA goals you can define each step of a funnel using any kind of event rather than being limited to a page URL. It also automatically calculates the completion, and abandonment rate for each step in a funnel.
- All GA4 events are hit-scoped and session scope is no longer available for events, parameters or user properties. Session count may be lower in GA4 because it is derived from the session_start event which will create differences in how sessions are measured.
- The default data retention period is just 2 months for GA4, and the maximum is only 14 months.
What GA4 Doesn’t Have?
- Views – you won’t find any views in GA4 and so you don’t have the ability to automatically focus on an individual device, hostname, subdirectory or some other user segment.
- Number of predefined reports. Universal Analytics has a larger number of pre-configured reports whilst GA4 has much greater flexibility in creating custom reports and it offers the ability to analyse data in BigQuery.
- Search Console. GA4 doesn’t yet allow integration with Google Search Console, but this is likely to come in time.
- Custom dimensions and metrics. Although these are not available, events or event parameters and user properties are designed to serve the same purpose as custom dimensions and metrics.
- Referral exclusion list. This may be released soon as it’s important to exclude domains that are integrated into the primary domain (e.g. secure login or payment gateway).
1. Upgrade to Google Analytics 4 in ‘Admin’ area of Universal Analytics:
I am assuming you already have a Google Analytics Universal Analytics account and have migrated to Google Tag Manager for managing your tags. If not, I strongly recommend you set up those first. To upgrade to GA4 go to your existing Google Analytics property and then go to the ‘Admin’ are and in the ‘Property’ column click ‘Upgrade to GA4’.
2. Get Started – Connect Your Google Analytics 4 Property:
The next page explains that your existing Universal Analytics property will remain unchanged. Click on ‘Get Started’.
3. Create a new Google Analytics 4 Property:
Now you will see the wizard for setting up GA4. However, because we are using GTM to implement GA4 the option to enable data collection using existing tags is not available. Click ‘Create property’.
4. Setup Assistant:
This is a list of settings and features you may need to configure to get the most out of GA4. Click on ‘Tag installation’ to enable you to set up GA4 using GTM.
5. Add Data Stream:
Now choose the data stream which was automatically created when you upgraded. Don’t click on ‘Add stream’ as this will just duplicate the stream you have already created.
6. Web Stream Details:
In the top right-hand corner of the page you will see the Measurement ID. Use the copy icon to add this to your Tag Plan as you will need this for creating tags in GTM. Now go to your GTM container and we’ll set up a pageview tag.
7. GA4 Configuration Tag:
If you are using GTM you will need to create a GA4 Configuration Tag to send data to you new GA4 Property.
Sign into the appropriate GTM container and go to:
- Name: GA4 – Config (paste your Measurement ID)
- Create a new folder “GA4” and save it into this new folder
- GA4 Configuration
- Trigger: All Pages
- Measurement ID: Past the ID you have just copied
8. GTM Preview Mode:
Before publishing the new tag enable GTM Preview mode (Google Tag Assistant) to test that the new GA4 tag is working correctly. To learn about how to use Google Preview and Debug mode check out my post.
Go to the Google Tag Assistant tab and you should see the GA4 container and the new GA4 pageview tag has fired.
9. Check GA4 Realtime Report:
It’s good practice to also check data is being sent to the GA4 Property by going to view the Real-time report. It may take a few minutes though for the real-time report to begin displaying data and this appears to be more problematic with properties that have just been created. If all goes well, you should see your hits in the real-time report as you navigate your site or app.
10. Publish GA4 Pageview Tag in GTM:
You can now publish the tag in GTM and begin collecting data from users. Ensure you give it an appropriate version name and description as this helps GTM users quickly identify the changes made for an individual version.
11. Exclude Internal Traffic:
To exclude internal traffic in GA4 go to
- Data streams
- Select the stream you want to exclude internal traffic from
- Additional Settings
- Tagging Settings
- Define internal traffic
This will take you to the screen to create a new internal traffic rule. Enter the name for the rule, the default traffic type is ‘Internal’, select the IP address operation (e.g. IP address equals) and the paste your IP address into the field. Finally, click ‘Create’ in the top right-hand corner.
12. Data Retention Length:
The default data retention period in GA4 is just 2 months and so it is worth adjusting this to the maximum of 14 months. In ‘Admin’ go to:
- Data Settings
- Data Retention
- Event data retention – select 14 months from the drop down
Now you have the basic set up for GA4 you can begin to plan setting up events. However, that’s another blog in its own right and you can check out my blog on how to track events in GA4 using Google Tag Manager if you want to begin creating events. Simo has also produced a quality blog post on GA4 events which I highly recommend you read. This is an implementation guide for events in Google Analytics 4 and will give you a comprehensive understanding of GA4 events.
The Google Analytics 4 console also allows you to create some events within GA4, which is a change from Universal Analytics where you either had to get a developer to hard-code events or use GTM. See my post how to create events in the GA4 interface for more details.
Final words on Google Analytics 4:
Google Analytics 4 complements what Universal Analytics offers and has some great innovative new features, including the use of AI to model incomplete data sets. The event-based approach of GA4 gives GA4 greater flexibility than Universal Analytics (UA), but this also means there is more work needed to create the number of reports that come ready built with UA.
In addition, there are gaps with GA4 which limits its capabilities and means that it can’t replicate many of the reports you may rely on from UA. As a result, it is likely that GA4 is not yet ready to meet all your web analytics needs. That’s why most experts believe it is best to run GA4 alongside UA until GA4 becomes a more mature and comprehensive platform.
That’s not to say you shouldn’t upgrade to GA4. Google have clearly stated that all future developments in web analytics will focus on GA4. That’s why it’s a good time to get on board with GA4 and begin learning about how to utilise and build on what this new platform offers. Google appear to be making frequent improvements to GA4 and so it will be much easier to keep abreast of these changes if you are already experimenting with the solution.
- About the author: Neal (@northresearch) provides web analytics and CRO consultancy services and has worked in many sectors including financial services, online gaming and retail. He has helped brands such Hastings Direct, Manchester Airport Group Online and Assurant Inc to improve their digital marketing measurement and performance.
- Neal has had articles published on website optimisation on CXL and Usabilla.com. As an ex-market research and insight manager he also had posts published on the GreenBook Blog research website. If you wish to contact us please send an email to email@example.com. You can follow us on Twitter @conversionupl, see Neal’s LinkedIn profile or connect on Facebook.