As an experience Google Analytics consultant, it would be remiss of me at this time not to write an article about GA4.
What Is Google Analytics 4 (GA4)?
Google Analytics 4 is the new reporting tool set to replace the Universal Analytics we all know and begrudgingly love.
You may or may not know, but if you’re reading this, I assume you do know, that Google are phasing out Universal Analytics to push everyone over to GA4 moving forward.
Here is the official announcement:
https://blog.google/products/marketingplatform/analytics/prepare-for-future-with-google-analytics-4/
What Is The Univeral Analytics / Google Analytics 4 Deadline?
As of July 2023, Universal Analytics will no longer be collecting data. You will still have access to your historical data for a further 6 months or so, then it will be gone. Forever.
(Well not quite forever I can offer solutions that will store historical data indefinitely for reference, get in touch if this is of interest).
In any case, now is the time to get set up on GA4 so that when the deadline does come, you will have at least 12 months or so data to look back on for those year-on-year comparisons.
This guide assumes you already have a universal account setup.
It is the first instalment of several guides I will be producing to help you get set up on GA4 and configure your tracking – down the line there will be guides on events, conversions, ecommerce tracking, and all the other UA features you have got used to over the years.
This is part 1 – how to get configured and get basic page view tracking in place.
How To Create a GA4 Account
- In your existing Universal Analytics account, select the property you wish to get set up on GA4 and select “GA4 Setup Assistant”:
- Click “Get Started”:
- Tick the box for “Enable data collection using your existing tags” and then “Create Property”. To be honest, at this stage, I’m not sure what happens whether this box is unticked or not. If you click “no thanks”, this guide has come to a premature end. Good luck.
- Upon creation you will see the following screen. Click “See your GA4 Property” to get to the setup assistant.
Note: The property ID displayed here IS NOT used for tracking purposes
- From the Setup Assistant, click through to “Tag Installation”:
- Select your newly created “Data Stream” from the list:
- Make A Note of Your Measurement ID:
By default, your tag will track:
a. Page views
b. Scrolls
c. Outbound clicks
d. Site search
e. Video engagement
f. File downloads
How To Implement GA4 Page View Tracking On Your Website
If you wish to add the tracking code directly into your site’s template, click on:
“Tagging Instructions”-> “Add new on-page tag” -> Global Site Tag (gtag.js)
This will give you the code you need to copy and paste into your site, and is as follows:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
Add this into the <head> section of the site and away you go.
How To Configure GA4 and Set Up Page View Tracking Using Google Tag Manager
If, like me, you are a Google Tag Manager Fanboy, you will want to set up your tracking using tags and triggers.
Again, this assumes you have a GTM account already set up on your site, and if you’ve got this far into this guide, then surely you have.
Create a new tag of type “Google Analytics: GA4 Configuration”:
Here, you have 2 choices, you can add your measurement ID as a custom variable, or, enter it manually. Either way, enter this into the “Measurement ID” box and tick “Send a page view event when this configuration loads”:
Then add a trigger for this to applied on “all pages”:
And that’s it, submit your changes and you are good to go.
Once your account has collected some data, you have a whole new range of reports and configurations to get your head around:
Stayed tuned for more GA4 config guides, and if you have any questions or need any assistance getting set up, please don’t hesitate to get in touch, am always happy to help.
Useful Resources
About The Author - Dave Ashworth
I would describe myself as an SEO Expert and a specialist in technical optimisation with a professional approach to making websites better for people and better for search engines.
When I'm not blogging, I deliver website optimisation consultancy and organic SEO solutions by addressing a website's technical issues and identifying opportunities for growth