How to create and manage triggers in Google Tag Manager

Author:

Creating and managing triggers in Google Tag Manager (GTM) is essential for controlling when your tags fire. Triggers determine the conditions under which a tag is activated, allowing you to track user interactions such as page views, clicks, form submissions, and more. Here’s a step-by-step guide on how to create and manage triggers in GTM.

1. Accessing Google Tag Manager

Step 1: Log In to GTM

  • Go to the Google Tag Manager website.
  • Log in with your Google account.
  • Select the appropriate GTM account and container associated with your website.

2. Understanding Triggers

In GTM, triggers are used to specify when tags should fire. Triggers can be based on various conditions, such as user interactions or specific page views. Some common trigger types include:

  • Page View: Fires when a page is loaded.
  • Click: Fires when a user clicks on an element (e.g., buttons, links).
  • Form Submission: Fires when a form is successfully submitted.
  • Timer: Fires at specified intervals.
  • History Change: Fires when the URL changes, such as with single-page applications.

3. Creating a New Trigger

Step 1: Navigate to Triggers

  • In the left sidebar, click on “Triggers.”
  • This will show you a list of existing triggers in your container.

Step 2: Create a New Trigger

  • Click the “New” button to create a new trigger.
  • A trigger configuration screen will open.

Step 3: Configure the Trigger

  1. Name Your Trigger: Click on the “Untitled Trigger” field and give your trigger a descriptive name (e.g., “Click – Sign Up Button” or “Page View – Home Page”).
  2. Select Trigger Type:
    • Click on “Trigger Configuration.”
    • Choose the type of trigger you want to create:
      • Page View: Fires on page load.
      • Click: Fires when a specific element is clicked.
      • Form Submission: Fires when a form is submitted.
      • Scroll Depth: Fires when a user scrolls to a specific depth on the page.
      • Custom Event: Fires based on a custom event.
  3. Configure Trigger Settings: Based on the trigger type you selected:
    • For Page View:
      • Choose whether to fire on “All Page Views” or “Some Page Views.”
      • If you select “Some Page Views,” you will need to define conditions (e.g., Page URL equals a specific value).
    • For Clicks:
      • Choose “All Elements” or “Just Links” depending on what you want to track.
      • Set conditions to specify which clicks to track (e.g., Click Classes, Click ID).
    • For Form Submission:
      • Choose whether to fire on “All Forms” or specific forms.
      • Define conditions as needed.

4. Adding Conditions to Triggers

When configuring your trigger, you can set conditions that must be met for the trigger to fire.

Step 1: Define Conditions

  • In the trigger settings, click on the dropdown menu to add conditions.
  • You can set multiple conditions using AND/OR logic:
    • Choose a Variable: Select from predefined variables or create a new one.
    • Condition: Choose the condition (e.g., equals, contains).
    • Value: Enter the specific value the variable should match.

Step 2: Save Your Trigger

  • Once you’ve configured the trigger and added any conditions, click the “Save” button.

5. Testing Your Trigger

Before publishing your trigger, it’s important to test it to ensure it functions correctly.

Step 1: Enter Preview Mode

  • In the top right corner, click the “Preview” button.
  • Enter your website URL to open it in a new tab with GTM preview mode activated.

Step 2: Check Trigger Firing

  • Navigate through your website while the GTM debug console is open.
  • Trigger the conditions you set (e.g., click the element, navigate to the page).
  • Check the console to see if your trigger fires as expected.

6. Managing Triggers

Step 1: Edit Existing Triggers

  • Navigate to the “Triggers” section in the GTM workspace.
  • Click on the trigger you want to edit.
  • Make your changes in the trigger configuration or conditions.
  • Remember to save your changes and test the trigger again before publishing.

Step 2: Disable or Delete Triggers

  • To disable a trigger, click on the trigger and change its status to “Disabled.”
  • To delete a trigger, click on the trigger and select the “Delete” option in the upper right corner.

7. Organizing Triggers

As you create more triggers, organizing them can help you manage your GTM setup more efficiently.

Step 1: Use Naming Conventions

  • Use clear and consistent naming conventions for your triggers to quickly identify their purpose (e.g., “Click – Contact Us Button”).

Step 2: Add Descriptions

  • Provide descriptions for each trigger, explaining its purpose and configuration. This helps when revisiting the container after some time.

8. Version Control

GTM allows you to track changes made to your triggers through versions.

Step 1: View Version History

  • Click on “Versions” in the left sidebar to see a history of all changes made to your container.

Step 2: Revert to Previous Versions

  • If necessary, you can revert to a previous version by selecting it and choosing the option to publish it.

9. Best Practices for Trigger Management

  • Test Before Publishing: Always preview and test triggers before making them live to avoid errors.
  • Document Changes: Keep a log of changes made to triggers for future reference.
  • Regular Audits: Periodically audit your triggers to ensure they’re functioning correctly and remove any that are no longer needed.

Conclusion

Creating and managing triggers in Google Tag Manager is crucial for effectively tracking user interactions on your website. By following the steps outlined above, you can set up triggers that specify when your tags should fire, helping you gather valuable data for analysis. With practice and adherence to best practices, GTM can significantly enhance your data tracking capabilities and overall marketing efforts.