Do you want to track anchor links in Google Analytics? Many WordPress single page themes rely on anchor tags for navigation.
For Google Analytics, these are all just a single page, making it hard to get meaningful statistics about the content viewed.
In this article, we’ll show you how to track anchor links in Google Analytics. Let’s dive right in…
Does Google Analytics Track Anchor Links?
Google Analytics doesn’t track anchor links by default, but that doesn’t mean it’s not possible. You’ll need to use a plugin like MonsterInsights to set up anchor link tracking.
Using anchor tracking lets you see how people interact with your site and what content they view, which is particularly helpful if you’re using a parallax or a single-page theme where your site’s entire content is published on a single page that uses anchor tags in the main menu instead of separate pages.
Luckily, with MonsterInsights, setting up anchor link tracking is super easy. Once the tracking is enabled, Google Analytics will start tracking your menus’ clicks as page views.
Let’s take a step-by-step look at tracking anchor links in Google Analytics.
How to Set Up Anchor Links in Google Analytics
To track anchor links, follow these simple steps and you’ll be done in no time.
Step1. Install and Activate MonsterInsights
MonsterInsights is the best Google Analytics plugin for WordPress. You can connect your Google Analytics account to your site and set up advanced tracking without editing any code or hiring a developer. You’ll get the insights that matter, right inside your WordPress dashboard.
Aside from one-click anchor link tracking, you also get access to tons of other Google Analytics features and sophisticated tracking, such as:
- File download tracking
- Custom event tracking
- Referral tracking
- Advanced form tracking and integration with popular form builders like WPForms, GravityForms, Ninja Forms, Formidable Forms, and more.
- Author tracking
- Outbound and affiliate link tracking
- And more…
To get started, head to MonsterInsights’ pricing page and grab the license level that works best for you. Next, you’ll need to install the plugin and connect Google Analytics to your site.
Just follow the setup wizard instructions, or you can use our detailed guide on how to properly set up Google Analytics in WordPress.
Step 2. Enable Enhanced Link Attribution in MonsterInsights
With MonsterInsights, you can track anchor links in Google Analytics in just a few clicks.
Once the plugin is active on your website and you’ve connected Google Analytics, go to Insights » Settings » Engagement and then navigate to Link Attribution.
Click the option to turn on Enable Enhanced Link Attribution and Enable Anchor Tracking.
Don’t forget to select the Save Changes button at the top.
That’s it! You’ve successfully set up anchor link tracking for your WordPress site. Now, are you wondering how to view data from anchor link tracking in Google Analytics?
Step 3: How to View Anchor Link Tracking Data in Google Analytics
Only one step left… We’ll show you how to track your anchor link metrics in Google Analytics.
From Google Analytics, navigate to Reports » Engagement » Pages and screens.
Next, click the drop-down menu at the top of the table to Page path and screen class. Now, you’ll see the anchor links tracking data along with any other pages’ data.
If you have other pages and would like to only view the anchor links, just use the search bar and type in a hashtag (“#”).
Congrats! You learned how to enable anchor link tracking in Google Analytics and track your hashtag anchor links as separate pages in Google Analytics.
If you enjoyed this article, you’ll definitely want to check out our Ultimate Guide to Google Analytics for Publishers & Bloggers
Not using MonsterInsights yet? What are you waiting for?
Don’t forget to follow us on Twitter, Facebook, and Youtube for the best WordPress tutorials and Google Analytics updates.
Is there an updated version of these instructions for use with GA4?
Hey Scott – Great question! Enhanced Link Attribution is an automatic feature of Google Analytics 4, so you can just skip the step of turning it on in Analytics. Then you should be set!
Also trying to use this with GA4, but unable to view anchor links tracking data anywhere. An update on how to view this data with Google Analytics 4 would be awesome!
Hey Paul – thanks for your comment! For now, anchor links in GA4 are actually reported with a “%23” instead of “#”. So, if you go to the Pages and Screens report, change your primary dimension from “Page title and screen class” to “Page path and screen class” and then search for %23, you should be able to see those anchor links. We’re currently looking into how to get this back to a # instead! Here’s a screenshot to help: https://a.supportally.com/ZfsWC7
Is there any update on this? We’re seeing that the %23 is working, but was wondering if # is still being worked on.
Hey Sean – This is a Google Analytics issue. We thought they had fixed it but I guess not! We’ll bring it up with them. For now, %23 will just have to be what you look for in your reports.