How to Track Tags in Google Analytics

Cody Schneider7 min read

Knowing which blog tags or content categories resonate most with your audience is a powerful advantage. When you understand what topics drive engagement, you can create more of what works and refine your content strategy. This guide breaks down exactly how to track your website tags in Google Analytics 4, giving you clear data to make smarter decisions.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Why Bother Tracking Content Tags?

Tracking tags isn't just about satisfying curiosity, it’s about gathering actionable data. By setting this up, you can:

  • Identify Your Most Popular Topics: Discover which themes and categories consistently attract the most clicks and page views. This helps you focus your content calendar on topics that have a proven track record.
  • Analyze Content Performance: Group articles by campaign, author, or keyword theme to see which clusters perform best. For example, you can see if your "Beginner's Guides" get more traction than your "Expert Interviews."
  • Improve User Experience: If you see readers frequently clicking tags for a certain topic, you might create more in-depth content or hub pages about it, making it easier for them to find what they need.
  • Measure Content ROI: See if specific content categories are more effective at driving conversions, like newsletter sign-ups or product demos.

The Big Picture: Connecting Clicks to Data

In the past, you might have set up event tracking in Universal Analytics, but the process has changed with GA4. The modern, and most robust, way to track tag clicks involves two tools working together: Google Tag Manager (GTM) and Google Analytics 4.

Here’s the basic workflow:

  1. Google Tag Manager: We’ll use GTM to "listen" for when a user clicks on one of your blog tags.
  2. Data Capture: When a click happens on a tag, GTM will grab the text of that tag (e.g., "marketing automation" or "SEO basics").
  3. GA4 Event: GTM then sends a custom event to GA4, including the tag name you just captured as an event parameter.
  4. GA4 Reporting: Inside GA4, we'll tell it to recognize this parameter by setting up a "Custom Dimension," making the tag name visible in your reports.

This process gives you precise, flexible tracking that doesn't require editing your website's code for every tag you want to track.

Step-by-Step: Tracking Tag Clicks Using GTM and GA4

Before you start, make sure you have both Google Tag Manager and Google Analytics 4 installed and connected on your website. Once that’s done, let’s get into the specifics.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step 1: Find Your Tag’s CSS Selector

First, we need to tell GTM how to identify a blog tag when it's clicked. We'll do this using a CSS selector. Don't worry, it's easier than it sounds.

  1. Go to a blog post on your website that has tags visible.
  2. Right-click directly on one of the tags and select "Inspect" from the dropdown menu. This will open your browser's developer tools.
  3. Look at the highlighted line of HTML code. You're looking for a common "class" or "id" that all your tags share. On many WordPress sites, tags are inside an <a> element with a class like post-tag or tag-link.

For example, you might see something like this: <a href="/tag/seo-basics" rel="tag" class="post-tag">SEO Basics</a>

In this case, the selector we'd want to use is .post-tag. The dot . signifies a class. Write this down as you'll need it in the next steps.

Step 2: Create a Variable in GTM to Capture the Tag Name

A "Variable" in GTM is a placeholder for a value that can change, like the name of the tag a user clicks. We need several Variables enabled for this to work. First, let's enable the built-in ones.

Enable Built-In Click Variables

  1. In GTM, navigate to the Variables section on the left-hand menu.
  2. Under "Built-In Variables," click Configure.
  3. Scroll down to the "Clicks" section and make sure all the boxes are checked (especially Click Element, Click Classes, Click ID, Click Text, and Click URL).

Now, we want the text of the actual tag link, which is captured by the Click Text variable. We don't need to create a new one for this, we just need to remember to use the {{Click Text}} variable later on.

Step 3: Create a Trigger to Fire on Tag Clicks

A "Trigger" tells GTM when to do something. We want a trigger that fires only when a user clicks on an element matching the CSS selector we found earlier.

  1. In GTM, go to the Triggers section and click New.
  2. Give your trigger a clear name, like "Click - Blog Tag".
  3. For the Trigger Configuration, choose the Just Links trigger type under the "Click" section. You can use an "All Elements" trigger if your tag isn't technically a link, but for most blogs, Just Links is correct.
  4. Select Some Link Clicks.
  5. In the conditions dropdown panels, set it to fire when: Click Element | matches CSS selector | .post-tag
  6. Save the Trigger configuration.
GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step 4: Create a Tag to Send an Event to GA4

Now that we have our Variable (the data) and Trigger (when to do something), it's time to put it all together with a "Tag." A Tag is the piece of code that fires on a Trigger's activation.

  1. In GTM, go to the Tags section and click New.
  2. Give your tag a name like "GA4 Event - Blog Tag Click".
  3. For Tag Configuration, choose the Google Analytics: GA4 Event tag type.
  4. If you don't have a GA4 Measurement ID set up yet, create one now under your GA4 settings.
  5. For Event Name, enter tag_click. This will be the event name you see in GA4 event reports.
  6. In Event Parameters, add a new row:
  7. Scroll down to the Triggering section and choose the trigger you just created ("Click - Blog Tag").
  8. Save your tag configuration.

Step 5: Set Up a Custom Dimension in GA4

To see the tag name in GA4, we need to register it as a "Custom Dimension." Do this by completing the following steps:

  1. In your GA4 account, click the Admin icon (the cog/glyph wheel icon) in the lower-left menu.
  2. Under "Property", look for Custom Definitions and select it.
  3. Click Create Custom Dimension.
  4. Give your dimension a name like "Blog Tag Name".
  5. Set the scope to "Event" and in the parameter field, type in tag_name, which is the event parameter you defined.
  6. Save your custom dimension.

Analyzing Your Tags with Secondary Dimensions

To see which tags are being clicked, you can add the custom dimension as a secondary dimension in your GA4 reports.

  1. Navigate to the "Events" report in GA4.
  2. Click on the tag_click event.
  3. You'll see a table with the count of clicks. To see the tag names, click on the "Add comparison" panel and select "Add Dimension".
  4. Select the custom dimension you just created, like "Blog Tag Name".

You will now see a table showing all the tags that users have clicked on, along with the counts of how many times each was clicked. This gives you direct insight into what topics your readers are actively engaging with.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

A Quick Note on Tracking Impressions vs. Clicks

It's important to understand that this method tracks clicks on tags. It does not track views of pages that have a certain tag. For example, if a user reads three blog posts tagged with "SEO Basics" but never clicks the tag itself, this setup won't record that behavior.

If you need to track how many times content with a specific tag is viewed — not just clicked — you would need a more advanced implementation involving the website's data layer. However, tracking clicks is an excellent and highly effective starting point for understanding how topics truly motivate users to engage.

Final Thoughts

Tracking tags in Google Analytics through the use of Google Tag Manager allows you to gather refined insights on what content categories are driving traffic and engagement. By using Variables, Triggers, and Tags in tandem, you can track clicks and send that data to GA4 for analysis. With this setup, you’ll be able to make smarter decisions about your content strategy without constantly updating your site’s code.

With every tag click now being captured, start making use of this data to plan and optimize your content roadmap, boosting your site's performance and deepening your understanding of audience interests.

To simplify this process and enhance your content strategy further, try using Graphed , a tool for managing your GA4 custom dimensions, analyzing click data, and ensuring all your tag tracking efforts are seamlessly organized.

Related Articles

How to Enable Data Analysis in Excel

Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!