Configuring Google Analytics & Tag Manager Integration

This article will walk you through the steps of setting up an integration with Google Analytics (GA) and Google Tag Manager (GTM) . This will let you automatically track page view and custom events, along with any other tags configured in your GTM containers.

Choosing the Right Integration

This document covers integration with Google's marketing technology stack
(Google Analytics 4, Google Tag Manager).

Looking for Adobe Experience Cloud integration instead?
See our Adobe Experience Cloud Integration guide.

When to Use This Integration

Integration Comparison

Feature Google Analytics & GTM Adobe Experience Cloud
Analytics Google Analytics 4 Adobe Analytics
Tag Management Google Tag Manager Adobe Experience Platform Tags
Personalization Limited (via GTM) Adobe Target/AJO
Data Layer Google Data Layer Adobe Client Data Layer
Cost Free tier available Enterprise licensing
Privacy GDPR/CCPA compliant GDPR/CCPA compliant

Integration Overview

The Google Analytics & Tag Manager integration provides a streamlined marketing technology stack that enables:

This integration is designed to work seamlessly with AEM Edge Delivery Services while maintaining optimal performance and user experience.

How It Works

The integration splits the traditional monolithic GTM approach into optimized phases:

Rationale

In a traditional GTM implementation, one container is used to initialize tracking and load all other containers. This approach typically has a performance impact on the initial page load, degrading the Core Web Vitals (CWV).

This optimized approach attaches tracking actions to the Edge Delivery Services phases. By splitting up the loading of the libraries and containers, we have minimized the impact on page performance, while maintaining page event tracking.

Performance Benefits

Pre-requisites

Before you can use this plugin, make sure you have access to:

You'll also need the following information:

GTM Container Configuration

Installation & Configuration

Step 1: Install the Plugin

Follow the technical steps in the aem-gtm-martech GitHub repository.

Make sure you implement and pass a consentCallback according to the documentation. This is essential for GDPR/CCPA compliance.

Privacy Considerations: The integration includes built-in consent management support. Default consent is set to require explicit user permission before tracking begins.

Step 3: Deploy Your Code

Commit and push your code branch to trigger the deployment.

Step 4: Test the Integration

Open a browser to the branch containing the plugin and verify the configuration.

Verification & Testing

To verify the configuration is correct you can:

Browser-Based Testing

Google Analytics Verification

GTM Preview Mode

Expected Network Activity

When properly configured, you should see:

The integration provides comprehensive privacy controls:

Troubleshooting

Common Issues

No tracking data in Google Analytics:

GTM tags not firing:

Performance degradation:

Debugging Tools

Demo & Examples

A demo site with the plugin can be found here.

Additional Documentation

Alternative Integration Options

Technical Resources

Google Resources