How to Set up Event Tracking with Google Tag Manager

Author:

Setting up event tracking with Google Tag Manager (GTM) allows you to track user interactions on your website, such as clicks, form submissions, and other actions. Here’s a step-by-step guide to set up event tracking:

 1. Log in to Google Tag Manager

  1. Go to Google Tag Manager and log in with your account.
  2. Select the container you want to work with.

 2. Create a New Tag

  • In the GTM dashboard, click on Tags in the left-hand menu.
  • Click on New to create a new tag.

 3. Configure the Tag

  1. Click on Tag Configuration.
  2. Select Google Analytics: GA4 Event if you are using Google Analytics 4 (GA4) or Universal Analytics if you are using the older version.
    • For GA4:
      • Select Google Analytics: GA4 Event.
      • Enter your Measurement ID.
      • In the Event Name field, enter a name for the event (e.g., button_click).
    • For Universal Analytics:
      • Select Universal Analytics.
      • Set the Track Type to Event.
      • Fill in the Category, Action, and Label fields according to the event you want to track (e.g., Category: Button, Action: Click, Label: Subscribe Button).

 4. Set Up Triggers

  1. Click on Triggering to specify when the tag should be fired.
  2. Select an existing trigger or create a new one:
    • To create a new trigger, click the + icon.
    • Choose a trigger type (e.g., Click – All Elements, Click – Just Links, Form Submission).
    • Configure the trigger details. For example, for a button click:
      • Select Click – All Elements.
      • Set the trigger to fire on specific clicks by choosing Some Clicks.
      • Define the conditions (e.g., Click Text equals “Subscribe”).
  3. Click Save to add the trigger.

 5. Save the Tag

  • After configuring the tag and adding triggers, click Save.
  • Give your tag a name (e.g., “GA4 Button Click Event” or “UA Button Click Event”) and click Save again.

 6. Publish the Container

  • Click on Submit in the top-right corner of the GTM interface.
  • Add a version name and description for the changes you’re publishing.
  • Click Publish to make the changes live on your website.

7. Test the Tag

  1. Use the GTM Preview mode to test your tag before publishing.
    • Click on Preview in the top-right corner.
    • This will enable the preview mode, and you can navigate to your website to see the tags in action.
    • Check the GTM debug console to ensure the event tag is firing correctly.
  2. Verify that the events are being recorded in Google Analytics:
    • Go to your Google Analytics account.
    • For GA4: Check the Realtime and Events reports.
    • For Universal Analytics: Check the Realtime and Behavior > Events reports.

By following these steps, you can set up event tracking in Google Tag Manager to monitor specific user interactions on your website. This allows you to gather valuable data for analysis and optimization.