Facebook Instant Articles AnalyticsTo add Google Analytics to Facebook Instant Articles for WordPress then you will need to add some extra code to your website. The official Instant Articles for WP plugin allows you to add the snippet in your advanced settings. If you're not already using this plugin, then I highly recommend you do and set that up first. It may not be the highest rated plugin but it is the official plugin developed by Automattic (the commercial entity behind a lot of WP) and Facebook.

Once you have completed your initial setup you will need to click the subtle link pictured below to get to the advanced settings section and find the Analytics section.

Step One

Facebook Instant Articles Advanced Settings

Step Two

Google Analytics For Facebook Instant Articles

This is where you will be adding the extra code to enable Google Analytics for Instant Articles. Whilst you could simply drop in the standard Universal Google Analytics snippet here and it would “work”, there are a few optimisations that can improve the data you'll receive.

Here is the snippet you should actually use, making sure to replace the UA-XXXXXXXX-XX with the actual Tracking ID that you can find inside your Google Analytics Admin page under the Tracking Info heading.

Update: New Google Analytics gtag.js Version

One of the most important things about this Google Analytics snippet vs the standard one is that it also sets up a Campaign Source and Campaign Medium so you this can be broken out in your reports to differentiate from other traffic. Additionally it also sets up the page title for your reporting by hooking into a javascript variable provided by Facebook. Whether you understand the above or not, know that this is a good thing that will help the data make sense inside your Google Analytics dashboards and reporting.

The last step that you may need to complete is to head over to your Facebook Page's publishing settings (you may find this under your pages settings or in Business Manager) and refresh your Feeds. The path to these settings is:

  • Publishing Tools > Instant Articles > Configuration > Production RSS Feed
  • Publishing Tools > Instant Articles > Configuration > Development RSS Feed

It should look something like this:

Refresh Your Facebook Instant Articles

With this step complete, you should have successfully installed Google Analytics on Facebook Instant Articles for WordPress. Make sure you monitor your analytics and over time you should start to see Facebook Instant articles beginning to show up in your Google Analytics data.

Addendum: How To Manually Add Google Analytics for Older Instant Articles

If you add the Google Analytics code after your articles have already been submitted to the Facebook Instant Articles service then the code may not be be added to older posts. There are two ways that you can combat this:

  • Option 1: Head into your WordPress dashboard and make an edit to all of the articles that you wish to update. After this you can resubmit your feed to Instant Articles. Facebook will detect the changes and update your Instant Articles including the analytics code at the same time.
  • Option 2: Head to the Production Articles section of Instant Articles in your Facebook settings and manually add the code shown below (Note the additional figure and iframe tags). Make sure you remember to add your custom Tracking ID as described in the previous method.

Update: New Google Analytics gtag.js Version

Which method you use will depend on which version of the analytics snippet you use and how many articles you need to update. If you have thousands of posts then you may want to select your most popular evergreen content to get started or make the decision to focus on posts made after Instant Articles.

You may also want to review the official Instant Articles development documents for further information.  



Scroll to Top