How to create and manage tags in Google Tag Manager

Author:

Creating and managing tags in Google Tag Manager (GTM) is essential for tracking user interactions on your website. Tags are snippets of code that send data to third-party tools like Google Analytics, Facebook Pixel, or other marketing and analytics services. Here’s a detailed guide on how to create and manage tags 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 the GTM Interface

Once you’re in the GTM workspace, you’ll notice the following key sections relevant to tag management:

  • Tags: Where you create and manage your tags.
  • Triggers: Define the conditions under which your tags will fire.
  • Variables: Used to store information that your tags and triggers can use.

3. Creating a New Tag

Step 1: Navigate to Tags

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

Step 2: Create a New Tag

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

Step 3: Configure the Tag

  1. Name Your Tag: Click on the “Untitled Tag” field and give your tag a descriptive name (e.g., “GA Page View” or “Facebook Pixel”).
  2. Select Tag Type:
    • Click on “Tag Configuration.”
    • Choose the tag type you want to use (e.g., Google Analytics, Facebook Pixel, AdWords, etc.).
      • For Google Analytics:
        • Choose “Google Analytics: Universal Analytics” or “Google Analytics: GA4 Configuration.”
      • For other services: Select the appropriate template or custom HTML tag.
  3. Set Tag Settings:
    • For Google Analytics:
      • Track Type: Set this to “Page View” for basic tracking or “Event” for specific actions (like clicks or form submissions).
      • Tracking ID: Enter your Google Analytics tracking ID (e.g., UA-XXXXXXXXX-X for Universal Analytics or the Measurement ID G-XXXXXXXXXX for GA4).
    • Fill in other required fields based on the tag type selected.

4. Setting Up Triggers for the Tag

Triggers determine when the tag will fire.

Step 1: Configure Triggers

  • Click on “Triggering” within the tag configuration screen.
  • You can choose an existing trigger or create a new one:
    • To create a new trigger:
      1. Click the “+” button to add a new trigger.
      2. Select the type of trigger you want (e.g., Page View, Click, Form Submission).
      3. Configure the trigger conditions (e.g., All Page Views or specific pages).

Step 2: Save Your Trigger

  • After configuring the trigger, click “Save” to associate it with your tag.

5. Previewing Your Tag

Before publishing your tag, it’s important to test it.

Step 1: Enter Preview Mode

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

Step 2: Check Tag Firing

  • Navigate through your website while the GTM debug console is open.
  • Check the console to see if your newly created tag fires under the specified conditions.

6. Publishing Your Tag

Once you’ve confirmed that your tag is working correctly:

Step 1: Submit Changes

  1. In GTM, click on the “Submit” button in the upper right corner.
  2. Provide a version name and description (e.g., “Added GA Tag”).
  3. Click “Publish” to make the tag live on your website.

7. Managing Tags

Step 1: Edit Existing Tags

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

Step 2: Disable or Delete Tags

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

8. Organizing Tags

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

Step 1: Use Naming Conventions

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

Step 2: Add Descriptions

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

Step 3: Grouping Related Tags

  • Consider creating a folder system or grouping related tags together to streamline your workspace.

9. Version Control

GTM allows you to track changes made to your tags 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.

10. Best Practices for Tag Management

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

Conclusion

Creating and managing tags in Google Tag Manager is a powerful way to streamline your tracking setup. By following the steps outlined above, you can effectively deploy tracking codes, manage triggers, and ensure that you’re collecting valuable data from user interactions on your website. With practice and adherence to best practices, GTM can significantly enhance your data tracking capabilities and marketing efforts.