How to setup Google Analytics (GA4) in Google Tag Manager

With GTM Kit it is easy to setup Google Tag Manager integration and push Google Analytics 4 events to Google Tag Manager. However, you still must configure Tag Manager to use that data and push it to Google Analytics.

This guide will show you how to import our Google Tag Manager template, which makes GTM configuration so much easier, and configure the necessary tags to make Analytics collect your data.

Install and configure GTM Kit

If you have not already installed GTM Kit, go ahead and do so and read the getting stated guide.

If you are using WooCommerce or Easy Digital downloads, you should also activate the integrations for Woo and EDD.

Once you have done that GTM Kit will send data layer data to Google Tag Manager and the next step is to configure Google Tag Manager.

Basic Google Analytics configuration

Whether you need simple tracking or advanced ecommerce tracking you need the same basic configuration tag. All GA4 implementations require the tag called Google Tag.

It is really easy to configure this tag but you can also import our template if you want.

First, I will show you how to configure the tag and then I will show you how to import a template.

Add configuration tag

The steps are as follows:

  • Click New Tag
  • Click Tag Configuration
  • Select Google Tag
  • Enter your Google Analytics 4 measurement ID
  • Enter a name for the tag. I.e. “Google Tag – GA4 Configuration”
  • Select a trigger
  • Save the tag
  • Publish your container

Import a container

Instead of setting up the tag manually you can import a container containing the tag. It may seem unnecessary in relation to the size of the task but sometimes but sometimes tags contain details that are easy to miss and therefor importing a container can be a safer way to get the job done.

Download the container file with the Google tag configuration.

Start the import by going to admin and click Import Container:

  • Select the container file
  • Select the workspace
  • Use the merge option or you existing container will be deleted
  • To be on the safe side you can choose to rename conflicting tags, triggers, and variables
  • Go throug the preview section and review the changes
  • Confim the import.

When you import a container from somebody else you usually have to make som changes or fill in som details. When you have importet our Analytics configuration template you have to fill in your own Google Analytics 4 measurement ID. Instead of entering it directly in the configuration tag you must enter it in the variable constant - GA4 Measurement ID.

Google Analytics ecommerce configuration

GTM Kit supports Google Analytics 4 ecommerce events for both WooCommerce and Easy Digital downloads installations. When you have activated and configured the ecommerce integration in GTM Kit you are ready to receive GA4 ecommerce events in Google Tag Manager.

In order to send those events to Google Analytics you to add and configure a GA4 event tag i GTM. This can be done by importing our GA4 ecommerce container.

Download the container file with the GA4 ecommerce configuration.

Import the container as described above.

Open the imported tag GA4 - Ecommerce Events and enter your measurement ID manually og or using a constant.

If everything is looking good you can publish the container.

That’s it. You are now measuring ecommerce events in Google Analytics 4.

Privacy and compliance

As alway you must make sure that you respect user privacy and make sure that you are in compliance with the laws in your country and the markets you are.

This is controlled in your GA4 configuration tag.

Depending on your consent management solution you can use another trigger instead of All pages or you can use GTM Consent Mode.