Implementing Digital Experience Analytics with Google Tag Manager

Begin by logging in to Google Tag Manager and selecting the account that you want to add the DXA script to. Click New Tag or Add a new tag as shown in the image below:

Adding a new tag in Google Tag Manager

From here, give the tag an appropriate name such as DXA, and under Choose Product, select Custom HTML Tag and then click Continue.Creating a new tag

In Step 2, Configure Tag, add the DXA script where it asks you to add HTML and then click Continue.
Note: You can find the DXA script for the relevant property by going to Settings > Property Settings > Tracking code from the DXA portal.
Adding the DXA script

In Step 3, Fire On, select the pages that you want the DXA tracking script to fire on and therefore collect data for. To fire and collect data for all pages, select All Pages such as in the image below. Then click Create Tag shortly followed by Publish.

Creating the tag

Upon clicking Publish, you will be given the option to preview and debug, which will allow you to see if the tag does fire as expected. Once happy with the changes, simply click Publish Now.Publishing the tag