How to Connect GTM to Google Analytics:
Step 1: Create a Google Analytics 4 Property
-
Go to Google Analytics
- Visit analytics.google.com
- Sign in with your Google account
-
Create New Property
- Click "Start measuring" or "Create Property"
- Enter property name:
Agentic Manufacturing
- Select your timezone and currency
- Click "Next"
-
Set Up Business Details
- Choose your business size and industry
- Select how you plan to use GA4
- Click "Create"
-
Get Your Measurement ID
- Copy the Measurement ID (format:
G-XXXXXXXXXX
) - This is your GA4 property ID
- Copy the Measurement ID (format:
Step 2: Configure GTM to Send Data to GA4
-
Open GTM Console
- Go to tagmanager.google.com
- Select your container:
GTM-5XFLRN8P
-
Create GA4 Configuration Tag
- Go to Tags → Click "New"
- Tag Name:
GA4 - Configuration
- Tag Type: Google Analytics: GA4 Configuration
- Measurement ID: Enter your GA4 Measurement ID (
G-XXXXXXXXXX
) - Trigger: All Pages
- Click "Save"
-
Create Event Tags for Your Custom Events
- Go to Tags → Click "New"
- Tag Name:
GA4 - Form Submission
- Tag Type: Google Analytics: GA4 Event
- Configuration Tag: Select your GA4 Configuration tag
- Event Name:
form_submission
- Event Parameters: Add your custom parameters
- Trigger: Custom Event → Event name:
form_submission
- Click "Save"
-
Repeat for Other Events
Create similar tags for:page_view
form_success
button_click
navigation_click
scroll_depth
section_view
Step 3: Set Up Triggers
-
Page View Trigger
- Go to Triggers → Click "New"
- Trigger Name:
All Pages
- Trigger Type: Page View
- Click "Save"
-
Custom Event Triggers
- Go to Triggers → Click "New"
- Trigger Name:
Form Submission
- Trigger Type: Custom Event
- Event name:
form_submission
- Click "Save"
Repeat for other events (
form_success
,button_click
, etc.)
Step 4: Test and Publish
-
Test in Preview Mode
- Click "Preview" in GTM
- Open your website with the preview URL
- Interact with forms and buttons
- Verify events are firing in the debug panel
-
Check GA4 Real-Time
- Go to GA4 → Reports → Reports snapshot
- Look for Real-time section
- You should see your events appearing
-
Publish GTM Container
- Click "Submit" in GTM
- Add version name:
GA4 Integration
- Click "Publish"
Step 5: Verify Connection
-
In GA4 Console:
- Go to Reports → Engagement → Events
- You should see your custom events listed
-
In Real-Time:
- Go to Reports → Reports snapshot → Real-time
- Interact with your website
- Watch events appear in real-time
🎯 Quick Setup Template:
Here's a simplified version you can follow:
-
Create GA4 Property → Get Measurement ID (
G-XXXXXXXXXX
) - In GTM: Create GA4 Configuration Tag with your Measurement ID
- In GTM: Create Event Tags for each of your custom events
- Test in Preview Mode
- Publish GTM Container
Once connected, all your events (form submissions, button clicks, page views, etc.) will be automatically sent to GA4 where you can analyze them in reports and real-time data.
Top comments (0)