In this short guide, I will walk you through how to create a new GA4 property for your website. This is part of a multi-step process I follow for my clients when migrating their Universal Analytics to Google Analytics 4.
In a hurry? Jump straight to these sections.
- Create a GA4 property
- Create a data stream
- Configure your data retention
- Create a GA4 config tag in GTM
- Test the config tag
- Verify in GA4's new debug mode
- Publish your tag
Who is this guide for?
I wrote this guide for the busy professional who needs just a bit of confidence and guidance in setting up a GA4 property. I expect you to be somewhat familiar with both GA and GTM. If you are completely new to both, I'd suggest taking a quick primer and then coming back to this guide.
Shameless plug - my essential guide to google tag manager is designed to get you up to speed with GTM.
Ready? Let's dive into it.
What you will need
- Admin access with publish level permissions for your Google Tag Manager container.
- Admin access for your Google Analytics account.
I suggest having both GTM and GA open in separate tabs. The steps we will need to take jump between the two.
Create a GA4 property
- In GA go to the admin section and click on create a property (it will default to GA4).
- Give it a name (something like GA4 - Website Name).
- Set the reporting time zone and currency to local or whatever you prefer (I'd go with the local time zone and currency).
- Ignore the advanced option (You do not want to create a UA property).
- Move to the next section.
- Ignore all the other fields and hit create. That's it. Your new GA4 property is created and ready to be tagged via GTM.
Create a data stream in GA4
- In the Admin section, make sure you are in the new GA4 property you created.
- Select Data Streams.
- Add a web data stream (you only need one per website in most cases).
- Enter the URL of your website.
- Give your stream a name (something like Web - Website Name).
- Keep all the enhanced measurement options ticked.
- Create stream. Done.
Configure your data retention in GA4
- In the Admin section, go to Data Settings > Data Retention.
- Change the event data retention from 2 months to 14 months. For GA360 customers, you will have the option to retain data for longer.
- Save. That's it. You are done.
Create a GA4 configuration tag in GTM
- Navigate to your GTM container and create a new tag.
- In the tag configuration, select Google Analytics: GA4 Configuration from the tag templates.
- In the other tab, you have open, select your data stream.
- Copy the measurement ID (not the stream ID).
- Paste it into the Measurement ID field in GTM.
- Don't change any of the defaults.
- Select All Pages as the trigger (we want this config tag to fire on all pages of the website).
- Give it a name (something like GA4 Config - Your Measurement ID).
- Save. Now you are ready to test the tag.
Test the GA4 config tag with GTM
- Open the preview and debug mode (preview button in the top right corner of GTM).
- Enter the URL of your site.
- Connect. Your site will open up in debug mode in a separate tab.
- In the preview tab, you should see the config tag under tag fire.
- Navigate to some other pages on your website. Every page that loads should also fire the tag.
- Now that you've confirmed it's firing, you can also check the tag in the new debug mode inside GA4.
Verify with the debug mode in GA4
- In GA4, navigate out of the Admin section and select the Configure section (top-left menu)
- Select DebugView.
- You will see a timeline of events.
- If everything is working as it should, you should see some page_view events and user_engagement events in the timeline.
- That's it. You are ready to publish the GA4 configuration tag.
Publish your GA4 tag with GTM
- In GTM, select Submit (top right corner).
- Provide a name (GA4 config tag) and a description (since there aren't multiple changes you can ignore this if you want).
- Hit Publish.
Done. You've just created a new GA4 property and published the basic config tag via GTM. GA4 comes with a lot of features out of the box such as scroll tracking which needed to be configured separately in the previous versions.
For now, this basic setup has you covered in terms of the foundations and you can further configure your setup based on your needs. For example, there are additional settings you might want to consider such as defining IP exclusions and listing unwanted referrals. I will try and cover these in another post.