Google Analytics 4 Tag Manager Setup: Complete Implementation Guide by Ayruz

Author : Vishak Kumar

Insight by: Vishak Kumar

Setting up Google Analytics 4 (GA4) using Google Tag Manager (GTM) is essential for accurate website tracking, flexible event management, and compliance with evolving privacy standards. At Ayruz Data Marketing, we help businesses implement scalable and validated GA4 setups that ensure reliable data for growth decisions.

This step-by-step guide walks you through:

  • The full setup process for GA4 via GTM
  • Advanced implementation tips
  • How to validate your tags are firing only once
  • Common mistakes and how to avoid them

Why Use Tag Manager for GA4 Setup?

Instead of embedding GA4 code directly into your site, GTM allows you to:

  • Implement and manage tags without touching code
  • Update event tracking dynamically
  • Debug and validate easily
  • Scale your analytics across multiple domains, apps, or subdomains

Ayruz Insight: GTM separates tracking logic from codebase, reducing developer dependency and enabling agile marketing analytics.

Step 1: Create a GA4 Property

  • Go to Google Analytics → Admin
  • Click “Create Property” and choose Google Analytics 4
  • Add website name, time zone, and currency
  • Click Web stream → Add your domain
  • Copy the Measurement ID (e.g., G-XXXXXXXXXX)

Step 2: Set Up Google Tag Manager

  • Visit tagmanager.google.com
  • Create a new account and container for your site
  • Copy and paste the container snippet into your site’s <head> and <body>
  • Use Google Tag Assistant Chrome extension to verify installation

Step 3: Add GA4 Configuration Tag in GTM

  • In GTM → Tags → New
  • Tag Type: GA4 Configuration
  • Paste the Measurement ID
  • Trigger: All Pages
  • Save and name clearly (e.g., GA4 - Config - All Pages)
  • Submit and publish the container

Ayruz Tip: This configuration tag loads the GA4 library and sends a page_view event by default. Avoid adding duplicate page_view events separately unless intentionally tracked.

Step 4: Set Up GA4 Events via GTM

To track user interactions like button clicks, downloads, or form submissions:

Example: Track Button Click

  1. Enable built-in GTM variables:

    • Click Classes
    • Click Text
  1. Trigger:

  • Type: Click – All Elements
  • Filter: Click Text equals "Download Brochure"
  1. Tag:

    • Tag Type: GA4 Event
    • Event Name: download_brochure
    • Event Parameters:
      • link_text = {{Click Text}}
      • link_url = {{Click URL}}

Ayruz Practice: Stick to GA4 recommended event names like sign_up, login, generate_lead for standardized reporting.

Step 5: Validate the Setup (Critical)

Proper validation ensures the tag:

  • Fires when expected
  • Does not fire multiple times
  • Sends the correct event and parameters to GA4

🔍 Tools to Use:

  1. GTM Preview Mode

    • Click Preview in GTM
    • Enter your site URL
    • Interact with tracked elements (clicks, forms)
    • See if the right tags fire once, and under the right conditions
  1. GA4 DebugView (in Realtime → DebugView)

    • Make sure page_view appears once on page load
    • Interact with elements and check if events (like download_brochure) appear
    • Confirm parameters like click_text are passed
  1. Google Tag Assistant

    • Shows if tags are loading and what data is being sent
    • Use to spot double firing (e.g., if both a hardcoded GA script and GTM send data)

Best Practice from Ayruz:
If you see two page_view events, it’s likely due to:

  • Having GA4 hardcoded + GTM setup (remove hardcoded)
  • Duplicating page_view inside both the config tag and a custom event

Common Mistakes to Avoid

Mistake Fix
Duplicate page_view events Use only the config tag for page views
Tags firing multiple times Add proper triggers and avoid generic “All Clicks”
No DebugView data Make sure you’re in Debug mode AND tracking with the correct ID
Incorrect event names Stick to GA4 recommended event schema

Optional: Server-Side GTM Setup (Advanced)

If you’re aiming for:

  • Faster site speed
  • Ad-blocker-resilient data collection
  • Enhanced privacy compliance

Ayruz also helps businesses migrate to server-side tagging using sGTM on Cloud Run or VPS, which ensures that analytics events are collected with greater control and precision.

🙋‍♂️ Frequently Asked Questions (FAQs)

How do I know if GA4 is working?

Use GA4’s Realtime report and DebugView. If you see a page_view when you load the site, and your custom events when interacting with elements, your setup is working.

Why is my event firing twice?

Most often due to:

  • Both hardcoded GA4 + GTM sending data
  • Using a Click – All Elements trigger without conditions

How long does it take for GA4 events to show?

In DebugView: immediate
In Realtime: Within seconds
In standard reports: 24–48 hours

Can Ayruz help with enhanced measurement or e-commerce tracking?

Yes. Ayruz offers GA4 consulting for:

  • Custom dimensions
  • Ecommerce (Shopify, Woo)
  • Lead tracking
  • Funnel reporting and Data Studio dashboards

Final Words from Ayruz

Implementing GA4 via GTM isn’t just about copying a tag. It’s about building a scalable, clean, validated measurement system that grows with your business. Whether you’re tracking leads, conversions, or user behavior, Ayruz ensures every click counts — accurately.

Need help validating your GA4 setup? Contact Ayruz Data Marketing for an audit or full implementation.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments