Skip to content

Mastering Google Tag Manager: How to Set Up Customized Triggers and Tags (with Examples)

    Google Tag Manager (GTM) is a powerful tool that allows you to manage marketing tags (snippets of code or tracking pixels) without editing code directly on your website. With GTM, you can create customized triggers and tags for a variety of purposes—from tracking form submissions and clicks to measuring scroll depth, video views, or even firing tags based on specific user behavior.

    In this blog post, we’ll walk through how to set up different types of customized triggers and tags using GTM, with real-world examples for each.


    📌 What Are Tags and Triggers in GTM?

    ✅ Tags
    Tags are pieces of code that help you do things like track website visitors, run ads, or collect data.
    📌 Example: A Google Analytics tag that tracks how many people visited your website.

    🎯 Triggers
    Triggers decide when a tag should run.
    📌 Example: You can set a trigger to fire a tag only when someone clicks a button or scrolls halfway down the page.

    📦 Variables
    Variables are like containers for dynamic info. They hold values that can change, like the page URL, the button text, or what someone clicked.
    📌 Example: A variable might store the exact link someone clicked on.


    ⚙️ Prerequisite: Setting Up GTM on Your Website

    1. Sign in to Google Tag Manager.
    2. Create a new container and select your platform (Web, iOS, Android).

    ✅ Common Customized Triggers and Tags (with Examples)


    🔍 1. Track Button Clicks (e.g., CTA Buttons)

    Use Case: You want to track how many users click the “Get Started” button.

    Step-by-Step:

    Trigger Setup:

    1. Go to Triggers > New > Click – All Elements.
    2. Choose “Some Clicks.”
    3. Set the condition:
    • Click Text contains "Get Started" OR
    • Click Classes equals "cta-button"

    Tag Setup:

    1. Go to Tags > New > Google Analytics: GA4 Event.
    2. Configure Tag:
    • Event Name: cta_click
    • Parameters: button_text = {{Click Text}}
    1. Trigger: Use the trigger created above.

    Result: Every time someone clicks the “Get Started” button, the event cta_click is sent to GA4.


    📝 2. Track Form Submissions (Lead Forms, Contact Forms)

    Use Case: You want to track when users submit a lead form.

    Step-by-Step:

    Trigger Setup:

    1. Go to Triggers > New > Form Submission.
    2. Enable “Check Validation.”
    3. Choose “Some Forms.”
    4. Condition example:
    • Form ID equals lead-form

    Tag Setup:

    • Tag Type: Google Analytics: GA4 Event
    • Event Name: form_submit
    • Parameters: form_id = {{Form ID}}
    • Trigger: Form Submission Trigger

    Result: Event is sent whenever the specified form is successfully submitted.


    🎯 3. Track Link Clicks to External URLs

    Use Case: You want to know how often users click outbound links.

    Trigger Setup:

    1. Enable built-in variable: Click URL
    2. Go to Triggers > New > Just Links.
    3. Choose “Some Link Clicks”
    4. Condition:
    • Click URL does not contain yourdomain.com

    Tag Setup:

    • Tag Type: GA4 Event
    • Event Name: external_link_click
    • Parameter: url = {{Click URL}}

    Result: Tracks when users click outbound links to other domains.


    📖 4. Track Scroll Depth

    Use Case: Understand how far users scroll down on a blog page.

    Trigger Setup:

    1. Go to Triggers > New > Scroll Depth.
    2. Choose Vertical Scroll Depths: 25, 50, 75, 100
    3. Select “All Pages” or specific page path.

    Tag Setup:

    • Tag Type: GA4 Event
    • Event Name: scroll_depth
    • Parameters:
    • scroll_percent = {{Scroll Depth Threshold}}
    • page_path = {{Page Path}}

    Result: Fires an event when users scroll to 25%, 50%, 75%, and 100%.


    🎥 5. Track YouTube Video Plays, Pauses, and Completions

    Use Case: Track engagement with embedded YouTube videos.

    Trigger Setup:

    1. Enable Built-In Video Variables: (Video Status, Title, URL, Percent, etc.)
    2. Go to Triggers > New > YouTube Video
    3. Choose actions: Start, Pause, Complete, etc.
    4. Apply to all or specific video IDs.

    Tag Setup:

    • Tag Type: GA4 Event
    • Event Name: video_engagement
    • Parameters:
    • action = {{Video Status}}
    • title = {{Video Title}}
    • video_percent = {{Video Percent}}

    Result: Tracks how users interact with embedded videos

    Table of Contents