How to install Google Analytics 4 (GA4)?

Install Google Analytics 4: discover our 4-step guide to installing Google Analytics on your website.

Matteo Maggini
Posted by Matteo Maggini
on 11/04/2022

As you probably know (if not, we recommend reading our latest article on the end of Universal Analytics), Google has announced that it will be deprecating Universal Analytics starting 1 July 2023. This means that your Universal Analytics properties will completely stop receiving data (hits) starting in early July 2023.

Google Analytics 4, or “GA4”, will replace its predecessor originally released in 2013.

If you have a Universal Analytics property and you don’t know how to set up GA4, you are in the right place! Read on.

In this guide? Discover how to add a Google Analytics 4 property

1. Create a Google Analytics 4 property

Log in to your Google Analytics account and access your Google Analytics account administration settings. Under “Property Settings”, look for the “Upgrade to GA4” link.

If you do not yet have a Google Analytics account, you must first create one for free by visiting the official Google Analytics page.

If the upgrade option is not available to you, you can click on the “GA4 Setup Assistant” section or click on “Create Property” to create a new GA4 property.

Upgrade options to GA4 with setup assistant

Click the “Get Started” button to begin the setup process with the Google Analytics setup assistant. You will then have several options depending on your current GA configuration.

Selecting the Google Analytics 4 property creation method from the setup assistant

If you are using the Global Site Tag to implement GA, the assistant will be able to enable data collection with your existing tags.

If you are not using the Global Site Tag, the following steps will show you how to enable data collection using Google Tag Manager (GTM).

Before you can start collecting data, you need to generate a measurement ID for your new GA4 property. The measurement ID is similar to the Universal Analytics ID. Enter the “Tag installation” menu. See the green box below.

Selecting the collection method from the setup assistant

GA4 does not have views like Universal Analytics. Instead, it features data streams. The data stream automatically measures certain events such as scrolls, outbound link clicks, site searches, file downloads, etc. Expand the drop-down list to add a stream and select the item you want to track.

In this example, we are tracking a website, so we’ll select Web.

Adding streams with web type selection

Configure your data stream by entering your website URL and stream name.

Click on “Create Stream” when you are finished.

Configuring the stream with adding the site URL and the name of the new Google Analytics 4 property

Now that you have your measurement ID, copy it as it is needed to configure the GA4 configuration tag in Google Tag Manager.

Now that you have your measurement ID, copy it as it is needed to configure the GA4 configuration tag in Google Tag Manager.

If you use a particular CMS such as WordPress, Magento, Drupal, etc. and your current version of Google Analytics was installed without going through the Global Site Tag or using Google Tag Manager (GTM) but thanks to a particular plugin, please refer to the documentation provided by the tool in question.

 

2. Add the tracking code to your website

Connect your free tag management tool Google Tag Manager and click on “Add new tag”.

Adding a new tag from Google Tag Manager

Select “Tag configuration” and choose “Google Analytics: GA4 Configuration” as tag type.

Tag type selection in Google Tag Manager for GA4 base configuration

Fill in the Measurement ID that is in your new property and that you previously copied and paste this ID into the Measurement ID field as shown in the image below.

Advice: We recommend that you create a constant variable for the measurement ID instead of entering it manually. This will allow you to reference the measurement ID for other tags and avoid inconsistencies in the future.

Added measurement ID in GA4 base configuration tag

Now that your tag is defined, you need to configure your trigger so that the code is triggered on all pages and click on “Save” to complete the configuration of GA4.

Choice of the type of trigger on all pages

You can now test your GA4 tag with the preview mode of your Google Tag Manager by clicking on the “Preview” button. 

 

Google Tag Manager preview button

Enter the URL of your site in the field provided.

URL field of the site to preview

You can publish your container to put the new tag online. Remember to publish your container after testing, otherwise your GA4 property will not receive data.

Button for submitting container changes from Google Tag Manager

Google Tag Manager container publish window

 

3.Enable data collection in Google Analytics

Return to Google Analytics to enable confirmation of user data collection. Access the administration settings of your Google Analytics account. Under “Data settings” go to the “Data collection” section then accept the “confirmation of user data collection”.

Google signals data collection configuration page

 

4. Verify that the GA4 property is collecting data

Once you add the Analytics tag to your website, Google Analytics starts sending data to your property very quickly (usually after 10-15 minutes).

To verify that your property is receiving data, check the “Real time” report. If you have configured your measurement code correctly, the Real-time Users card should refresh every 15 seconds or so (showing a new number of users).

Real-time report from Google Analytics 4 indicating that a user is on our website and that Google Analytics 4 is working correctly

 

It takes 24-48 hours for Analytics to process data from other reports.

Conclusion

Now that you have completed the base configuration of GA4, you can start using it to more effectively track users and their actions. Note that events and conversions are not automatically migrated from your UA account to GA4. In order to find all your conversions and events, and therefore continue to follow your main KPIs, you will need to configure them via GTM. The same goes for e-commerce measurements.

Do not hesitate to contact us for any request, whether at the strategic or operational level. Our web tracking specialists will be happy to support you at every stage of your project.

Posted in : Analytics

Let's get in touch





    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

    Newsletter

    Subscribe to our newsletter (in french only).