How to Set Up Google Analytics in Google Tag Manager
Learn how to add the Google Analytics tag to GTM and ensure it respects consent preferences using Pandectes.
Introduction
Google Tag Manager (GTM) is a powerful tool that allows you to manage and deploy tags, such as Google Analytics, without modifying your Shopify theme code.
When integrated with Pandectes GDPR Compliance, GTM can ensure that tracking scripts only run based on the consent given by your visitors. One of the most commonly used tags in GTM is Google Analytics, which provides deep insights into user behavior across your store.
Step-by-Step Guide to Add Google Analytics in GTM
Step 1: Open Your GTM Workspace
- Visit https://tagmanager.google.com
- Sign in with your Google Account
- In the Accounts tab, select your container
- Under Workspaces, go to Tags and click New
Step 2: Configure the Google Analytics Tag
In the tag setup panel:
- Name your tag (e.g.,
GA4 Config
) - Click Tag Configuration
- Select the Google Analytics tag type from the Featured Tags section and choose Google Tag
- In the Tag ID field, enter your GA4 ID (e.g.,
G-XXXXXXX
) - (Optional) If you're using a custom pixel for page views:
- Click Add Parameter under Configuration Settings
- Set parameter name to:
send_page_view
- Set value to:
false
- In the Triggering section, choose Initialization – All Pages
Step 3: Save and Publish
- Click Save
- Then click Submit to publish the tag live on your store
Updated on: 15/07/2025
Thank you!