How to Add Google Analytics to AMP Pages in WordPress (The Easy Way)

How to Add Google Analytics to AMP Pages in WordPress (The Quick Way)

We’re often asked by visitors that how can we accurately track traffic that’s coming from AMP pages to our WordPress website?

AMP or accelerated mobile pages allows your website content to load quickly on mobile devices. But when it comes to tracking your visitors in Google Analytics from AMP, many people find the process difficult and complex.

That’s because it requires editing the tracking code on your website. This means you’ll need technical knowledge, or you’ll have to hire a developer.

So, is there an easier way?

ExactMetrics is the best WordPress Analytics plugin. Get it for free!

In this article, we’ll show you how to add Google Analytics to AMP pages in WordPress without the need to touch a single line of code. Let’s begin…

What is Accelerated Mobile Pages (AMP)?

AMP is an open-source project by Google and its aim is to provide a seamless user experience on mobile devices. So, if you want to make sure your webpages open in an instant on mobile without any delay, then you need to enable AMP on your site.

But you might wonder, why is AMP important?

Since Google has now gone mobile-first, you have to ensure that your site works properly on mobile devices without hindering the overall experience. Mobile-first means that Google will give preference to a site’s performance on mobile as compared to desktop and will rank them higher.

So, if you want to make sure your site ranks in the top 10 results on Google, you can use AMP to improve its performance. Now, here’s what a search result with AMP looks like on a mobile device. You’ll notice the AMP symbol (a lightning bolt) next to the URL.

With that, let’s see why you should track traffic from AMP on your website in Google Analytics.

Why Track AMP Pages in Google Analytics?

Now, if you’ve enabled AMP on your site, then it’s important to know how many people visit your site using it. By collecting data about traffic from AMP can help you make decisions to grow your business.

You can see which pages are popular and drive a lot of traffic from AMP, so you can create more content around similar topics. And you can provide personalized messages for AMP users, so you can easily convert them.

But adding Google Analytics to AMP webpages isn’t that straight forward. That’s because it requires you to edit the tracking code on your website manually. Now unless you’re a developer this shouldn’t be a problem. But many beginners, editing code is difficult.

Another problem you’ll have to look into when adding Analytics to AMP pages is to avoid counting the same visitor twice. If a visitor visits your site through AMP and then through a desktop, Google Analytics will count it as 2 different sessions.

This will mess up your reporting and won’t give you accurate traffic stats. So, how can you avoid these issues?

With ExactMetrics, you don’t have to worry about coding or inaccurate reporting on AMP pages. It’s the best premium WordPress Analytics plugin.

Let’s see how you can configure it on your WordPress site and add Google Analytics to AMP.

How to Set Up Google Analytics on AMP in WordPress

To add Google Analytics for tracking AMP web traffic, just follow these steps. And we promise you won’t need to edit any code.

But before you start, make sure that you have the AMP plugin installed on your WordPress site. It’s the official plugin by the AMP project team and Google. It’s how you can provide a smooth and fast experience to uses on mobile.

Once that’s taken care of, let’s start the tutorial.

Step 1: Install ExactMetrics WordPress Plugin

The first step is to install ExactMetrics on your website. It’s the best WordPress plugin for tracking your visitors, getting insights about how people use your site, and set up advance tracking.

exactmetrics-best-wordpress-plugin-for-google-analytics

Using ExactMetrics, you can easily connect Google Analytics to your WordPress site. Just follow it’s set up wizard and you’ll be done in no time.

Besides that, you could do so much more with ExactMetrics:

  • Accurately track traffic from AMP and stop double tracking
  • Automatically track file downloads, outbound links, etc.
  • Track eCommerce performance in just a few clicks
  • See which forms convert the best
  • Get detailed reports inside your WordPress dashboard
  • Set up custom dimensions for additional tracking
  • Split test AMP pages using Google Optimize

You can read our detailed guide on how to install ExactMetrics plugin.

Step 2: Install and Activate ExactMetrics AMP Addon

After setting up ExactMetrics and connecting your site with Google Analytics, the next step is to install its AMP addon. Do note that you’ll need ExactMetrics Plus or a higher plan to use the addon.

You can start by going to your WordPress dashboard and then navigating to ExactMetrics » Addons. Now go to AMP and click Install.

install amp addon

The addon will automatically install and activate on your website. You can see the status change to Active, which means it’s ready for use.

Step 3: Enable AMP in ExactMetrics

Now that you’ve installed the AMP addon, you’ll have to enable it’s tracking in ExactMetrics.

To get started, go to ExactMetrics » Settings » Publisher. Next, scroll down to Google AMP and then click on the toggle to enable the option.

If you have a consent box on your website for GDPR compliance, then another option will appear under Google AMP. The option will say Wait for AMP consent box. If you enable this, then the AMP tracking code will not load until the user grants permission.

Once you’re satisfied with the settings, click Save Changes at the top and your Google Analytics AMP tracking will automatically start. No additional steps required.

How to View AMP Traffic in Google Analytics

Now, you might be wondering, how can you view your AMP pages traffic in Google Analytics?

To view how many people come from AMP to your website, login to your Analytics account. Then go to Behavior » Site Content » All Pages. Here you’ll see all the pages that are driving traffic to your website. To view stats from AMP pages, enter /amp in the search bar.

amp pages in google analytics

This will show all your AMP pages that are sending traffic to your website. You can then click on any of these pages and use secondary dimensions to find more insights. For instance, you can use source/medium to see which channel your visitors are using to view AMP pages.

With that, you’ve made it to the end of the guide!

We hope you liked our article on how to add Google Analytics to AMP pages in WordPress. If you want, you can also check out our post on how to set up visitor tracking in WordPress.

And don’t forget to follow us on Twitter and Facebook to get to know the latest tutorials on Analytics.

Want to Try ExactMetrics for Free?

Enter the URL of Your WordPress website to install ExactMetrics Lite.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.