to set Google Analytics 4 up using Google Tag Manager

Google Analytics 4 provides a robust and event-based method of tracking website activity.

Many marketers have had to relearn their favourite analytics platform due to the removal of Universal Analytics. They now use a completely different interface and go through a new set-up process.

Conversion setup comes with a steeper learning curve.

Google Tag Manager (GTM), which can be used to set up GA4 on your website, will make it easier and less complicated than customizing code.

This article will demonstrate how to deploy basic GA4 tracking code via GTM. It also demonstrates how to create custom events to collect more detailed data.

How to set the main GA4 code

The gtag.js tag, which is the basic tracking code that you should place on your website, is what you will need. After you have set this up for all pages you will start recording all data GA4 has for your website visitors.

GTM makes it easy to set up this tag by simply clicking and pasting an account ID.

Notice: You can activate Universal Analytics tags (analytics.js), if they are already active on your site. Google states that Universal Analytics will cease to record data as of July 1, 2023. However, GA360 properties will continue to record data until July 1, 2024. After this date, data will still be available for at least six more months.

Step 1

Navigate to the account or container you wish to use within GTM, and click “Add a tag.”

Step 2

Click on “Tag Configuration” now to view the options for different types of tags. Select Google Analytics: Configuration.

Step 3

There will be a field for you to enter your MeasurementID. Copy your Measurement ID from your account and paste it here.

You can save this tag so you don’t have to hunt for it each time you set up GA4 events.

Most users will want to check the box to “Send page view events when this configuration loads.” This will ensure that every time a user visits new pages, GA4 tracks it.

You might not want to fire a Pageview in some cases. You might not want to fire a pageview in some cases, such as when you use a tag for setting properties for logged-in users or customers who complete transactions without changing the page URL.

Step 4

To choose the location where the tag should fire on your site, click within the “Triggering” box. GA4 should fire on all pages in most cases.

Depending on your setup, however, you might want to exclude pages such as the private login section.

To customize where the tag fires, you can create rules based upon URL paths and clicks on certain page elements.

Step 5

To push your GTM container live, save your tag. Now you should see GA4 firing at your site.

Double-checking that your sessions are being tracked is possible by visiting the Realtime section in Google Analytics. After visiting the site, you should see your visit here.

Once you have the basic gtag.js tag, you can add customization, such as events.

Get the daily newsletter search marketers rely on.

“>
“>
“>

Processing…Please wait.

Google Tag Manager – Setting up event tracking in GA4

GA4 builds on its core focus of event-based measurement by offering built-in event trackers for a few site interactions.

You can activate Enhanced Measurement directly within GA4 to fire scroll activity, outbound clickings, file downloadings and video views.

These events have limitations, however, compared to the more advanced tracking options that can be set up through GTM.

Scroll tracking simply triggers an “scroll event” when the user reaches the bottom (measured at 90%). You won’t be allowed to track the time the user scrolls to other points on the page.

GTM allows you to fire events that correspond to different scroll thresholds (e.g. 25%/50/75%/100%) for a deeper analysis.

GTM’s beauty lies in its ability to fire events quickly for a wide range of actions users could take on the site.

Scroll tracking will be used as an example event setup. However, you can also use the GA4 Event Tag to create events for all triggers in GTM.

Step 1

Create a new tag using the Tag Type “Google Analytics: GA4 Events” to get started. Choose your GA4 ID under “Configuration Tag.”

Step 2

Next, enter your Event Name to be displayed in the Google Analytics interface. To align with the “scroll”, GA4 already tracks, we are using “scroll”.

Step 3

To expand the Event Parameters section, click on it. To send additional details to Google Analytics, you can add a custom para.

In this instance, we will send percentage values to people who scroll to certain points on a page.

Step 4

For the Parameter Name, we’ll use “scroll_depth”.

Next, the value of the scroll depth threshold will be set. This variable is part of GTM and pulls in scroll percentages when people interact with the page. Data is then sent back to the GTM.

Step 5

To determine the values that we want to track, we will need to create a trigger. To create a trigger, click in the bottom Triggers section and choose Scroll Depth Trigger.

The scroll depth can be set vertically or horizontally, and you can also choose between percentage tracking or pixel tracking.

The percentage option is probably the best choice, considering the wide range of screen sizes that people might be viewing. Add the numbers you wish to track and separate them with commas.

Step 6

Save the trigger and save your tag before publishing it live.

When you go to Analytics Events section, you will see more scroll data.

To fire additional events into Google Analytics, you can use the same model as above.

You can either pull from default G4 events, or create your own event names. You can add parameters to provide additional information and variables.

It is much easier than you might think to set up GA4 or GTM.

Get GA4 set up with GTM today. GA4 is now mainstream. Businesses looking to track online performance will need a well-configured property.

GTM is the easiest way to set up a GA4 system. It’s customizable and easy to use. Once you have GA4 activated, you can think about the actions that you want to track and create events.

Search Engine land first published the post Setting up Google Analytics 4 with Google Tag Manager.

Leave a Reply

Your email address will not be published. Required fields are marked *