fbpx

How To Generate Google Analytics 4 Tracking Script & Install On Website

Installing Google Analytics 4 is a requirement given the sunsetting of Universal Google Analytics.

Google Analytics 4 (GA4) is the next generation of Google Analytics and will
replace Universal Analytics after July 2023. Unlike the old Universal Analytics (GA3)
properties, GA4 can be used for a website, an app or both together. GA4 leans into Machine
Learning to offer you market trends and customer behaviour across devices and platforms.

Implementation Architecture #

The most important step is to understand how Google Analytics is set up.


There are several implementation options for GA4 such as:
• Directly in the code
• Via GTM
• CMS integration via plugin

With so many options available, the best implementation will vary according to business
models and objectives. Before selecting an option, outline your priorities as this will help
define the best implementation option for your current needs.


Why is this necessary? If you want to set up conversion tracking or configure consent
mode, you need to keep to one implementation option to keep the tracking clean.
If you prefer a code implementation, everything should be configured directly in the source
code.


If using Google Tag Manager, it is recommended to set up all tags via GTM.

This will ensure clean tag handling and efficient tracking.

Step 1 – Find Google Analytics Account #

CleanShot 2022 05 11 at 23.07.41@2x
Locate the correct Google Analytics profile.

Step 2 – Generate Tracking Script For Google Analytics 4 #

Once here, click to admin and then click Google Analytics 4.

CleanShot 2022 05 11 at 23.08.18@2x

Create a new Google Analytics 4 property.

CleanShot 2022 05 11 at 23.08.55@2x
CleanShot 2022 05 11 at 23.09.32@2x

Explore the setup assistant.

CleanShot 2022 05 11 at 23.10.11@2x

Step 3 – Install Tracking Code via <head> or via Google Tag Manager #

Get ready to install the Google Analytics 4 tracking tag!

CleanShot 2022 05 11 at 23.10.41@2x

Install the “Web” tracking script / stream.

CleanShot 2022 05 11 at 23.12.51@2x
CleanShot 2022 05 11 at 23.13.21@2x

Now, install on the page in the <head> OR via Google Tag Manager (each site may be different.

CleanShot 2022 05 11 at 23.22.27@2x

Google Tag Manager #

CleanShot 2022 05 11 at 23.24.57@2x
CleanShot 2022 05 11 at 23.26.36@2x

Then, install via GTM on “all pages” triggering/firing with the ID number from your account above.

Video Walkthrough: Google Tag Manager #

Video walkthru for the Google Tag Manager version of installation

Video Walkthrough: Submitting Code Via Ticketing System #

How to send the Google Analytics 4 tracking code via a ticketing system (example: ICND)

FOR VACATION RENTAL BUSINESSES:

Get A FREE Chapter Of "Mastering Vacation Rental Marketing"

This field is for validation purposes and should be left unchanged.