Your tag should look like the following screenshot:
This is your first tag set up, to register all product views in GA4. Due to the parameters added in here, it will also carry through all the product data we have specified.
- Start a new tag, naming it ‘Push GA4 - Add To Basket’, selecting the same tag type & configuration as before
- The event name for this tag is ‘add_to_basket’ and the parameters are as follows:
- Parameter name: items / Value: {{Push - Items}}
- Parameter name: value / Value: {{Push - Value}}
- Parameter name: currency / Value: {{Push - Currency}}
- Parameter name: item_category / Value: {{Push - Category}}
- Parameter name: item_category2 / Value: {{Push - Category2}}
- Parameter name: item_category3 / Value: {{Push - Category3}}
- Select a new trigger and name it ‘Push - Add To Basket’. Add in the event name ‘add_to_cart’
- Save the tag, which should look like this:
- Start another new tag (last one, almost there!), name it ‘Push GA4 - Transaction’ selecting the same tag type & configuration as previously covered
- The event name for this tag is ‘purchase’ and the parameters are as follows:
- Parameter name: items / Value: {{Push - Items}}
- Parameter name: transaction_id / Value: {{Push - Transaction ID}}
- Parameter name: affiliation / Value: {{Push - Affiliate}}
- Parameter name: value / Value: {{Push - value}}
- Parameter name: currency / Value: {{Push - Currency}}
- Parameter name: item_category / Value: {{Push - Category}}
- Parameter name: item_category2 / Value: {{Push - Category2}}
- Parameter name: item_category3 / Value: {{Push - Category3}}
- Select a new trigger and name it ‘Push - Transaction’. Add in the event name ‘purchase’.
- Save the tag, which should look like this:
Now you should have got to a stage where in this workspace, there are 3 new tags, all using various variables and triggers to pull through the relevant data and information. We recommend running through each of the tags again, making sure all the variables are in place and then submitting the changes live to your website. We would also recommend running through debug mode to check all triggers are firing correctly before going live, which we explain below.
Debug And Testing for GA4 Tagging
When pushing anything live on your website, it is always important to check it is working properly. It sounds obvious, but this is an often overlooked step (amazing, we know). To check your tagging setup through GTM & GA4, there are a few tools we can use. First is the ‘preview mode’ in GTM, which is used to make sure the tagging and triggers are all correctly firing on the website, and the variables are pulling through the right data. Secondly, we can use the new GA4 debug tool, which allows a real-time look at what tags are being triggered in GA4 (effectively, to make sure the link between GA4 & GTM is working correctly). We recommend running these simultaneously and cross-checking the data to make sure there aren’t any discrepancies. Let’s get going!
- Enter preview mode through GTM, by clicking ‘preview’ when in the main workspace, and then adding in your URL
- This should take you to your website, with a pop-up for Google tag assistant present, as per the below example:
If you navigate back to your tag manager window, you should see a similar window to the below. The key here is to see if the tag ‘GA4 Configuration’ has fired. This means that the GA4 tag is working on your website. You will also see your other tags that have been set up in the ‘Tags Not Fired’ section, which is correct:
We would then suggest setting up a tab with your GA4 open, where you then can navigate to the debug mode. To do this, you go into the left-hand menu and go to configure, and then DebugView, where you will then see the following view:
Here, you should be able to see a real-time view of the actions that you are performing on the website. In the example screenshot above, the debugging has picked up that we have been on multiple pages, viewed a few items and then added multiple to the basket. This is all reported in real-time, meaning you can monitor what actions you have performed and what is being picked up by the debug mode.
We would recommend running through a full test purchase, monitoring both debug mode in GA4 and the preview mode in GTM to test whether your triggers fire at each stage, and are subsequently imported into GA4 accurately. Your GTM preview should look like the below, once the purchase has been completed:
To check the correct data is being pulled through (the right products, prices etc.) select the data layer tab, and you should see the below:
As you can see in the example, we have 2 different Trek Marlin 4’s that have been purchased, with the full value, currency and product names being pulled through accurately.