Skip to content

GTM Setup

The following is the base GTM Setup that is needed for GTM to get Universal Analytics and GA4 on the site.

New GTM Setup

  • Create a New GTM Account and Container, if not already provided by the merchant.
    • The target platform should be web.
  • If the merchant is adding us to the Account/ Container, make sure we're an administrator OR allow us the following Permissions:
    • Publish
    • Approve
    • Edit
    • Read
  • During the quickstart questionnaire you will be prompted to enter your GTM container ID (GTM-XXXXXX).
    • This value will be automatically be added to GTM-dataLayer.mvt and GTM_Import.json, and will replace <%- GTM_ID %> in both files.

Setting up Universal Analytics and GA4

Utilize our GTM Import to quickly set-up Universal analytics, as well as GA4.

If the merchant is not using GA4, you can just remove everything that is filed under the folder "GA4".

To Import the following file, you will need to go to Admin > Import Container.

Click here for a Quick Screenshare of how to do it.

Make sure to import it to a new workspace, so you can make adjustments if needed.

If the merchant has GTM setup, and it's on a live store, you will either want to make a new container (Copy their current one into it), or create a workspace for any changes.

Recommendation: Create a new container if there are many changes. You can always import the new container over when you launch the site, or continue using the new container.

Google Analytics Property

Make sure to update the Google Analytics Property to your Google Analytics Tracking Id with the proper values.

The Input is the Page hostname (example: www.mysite.com, or dev.mysite.com).

The Output is the Google Analytics Track ID.

GA4 Measurement ID

Make sure to update the GA4 Measurement ID to your GA4 Measurement ID with the proper values.

The Input is the Page hostname (example: www.mysite.com, or dev.mysite.com).

The Output is the GGA4 Measurement ID.

Debugging

To Debug both Universal Google Analytics and GA4, you will need the Google Analytics Debugger Chrome Extension.

Once downloaded, enable the extension by clicking it.

The developer console will display GA and GA4 hits.

If you want to debug GA4 specifically:

  • Go to Google Analytics
  • View your GA4 Account/ View
  • On the left, click Configure
  • Click DebugView

If multiple people are on the site with the debugger, you will need to select your device from the Debug Device list.