How to Add Google Analytics Code to Facebook Instant Articles for WordPress

0

Google Analytics is the most helpful and important tool which every webmaster uses. It helps to get proper information about user behaviour on our website. Google Analytics helps in understanding from where the traffic is coming on website and what user is doing. To track users activity on your website, We have to place Google Analytics code in the header of site.

To add Google Analytics Code to Facebook Instant Articles for WordPress you will have you add the code in your site after installing the Instant Article for WP plugin which allows you to add 3rd party to Instant Article. It is advisable to add this plugin to your site as it is the best in the industry and most of the bloggers use this plugin in their site.

How to Add Google Analytics Code to Facebook Instant Articles for WordPress

How to Add Google Analytics Code to Facebook Instant Articles for WordPress

All you have to do is setup Instant Article in your Facebook Page and also add Instant Article WP plugin and add the Google Analytics code in the plugin which you install in your site.

Step 1

You have to apply for Instant Article approval. You have to follow some guidelines of Facebook before applying for Instant article or else it will get rejected. Check below image which shows what to do once your IA is approved.

instant article google analytics tracking

Step 2

How to Add Google Analytics Code to Facebook Instant Articles for WordPress

You have to add the Google Analytics code as shown in the above image. You just have to copy paste the code from Google Analytics to admin to the Instant article plugin. Also you can optimise some data if you want to to get accurate information of traffic flowing on your site.

Below we have shared the complete Google Analytics code which you can paste in the Instant Article plugin. Just replace the UA-XXXXXXXX-XX with your actual Tracking ID which you will find under tracking info in Google Analytics admin page.

 

Latest Update: New Google Analytics gtag.js Version is now available. You can find it below.

 

One of the most important difference between the old and the new version of code we have shared is that the new version of code will setup a campaign source and campaign medium for you so it will be easy for you to record the traffic flow on your site from different sources.

The final step which you will have to complete without which the code will not work is to open your Facebook Page publishing settings, you will get it under page settings and the refresh the feeds.

Below show is how you can go the the path.

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

It should look as shown below in the image.

Add Google Analytics Code to Facebook Instant Articles

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

If you want to add Google Analytics code to the Instant article on FB once the article is in production and published then their are two different ways to combat this situation.

1st Option : Just go to all posts in WordPress and update all the posts in which you want to have Google Analytics code and then resubmit the feeds to Instant Article. Facebook will detect the changes and your Analytics code will be updated in IA.

2nd Option : Go to the production articles in Instagram section of your Facebook Page and manually add the code that we have shared below. Also don’t forget to change the Tracking ID in the below code to your own Google Analytics ID.

Update: New Google Analytics gtag.js Version

 

 You can use any method that you like to add Google Analytics code to Instant Article in WordPress.

Comment below if you have any doubts or face any issue in placing Google Analytics code to Instant Article. We will be happy to help.

Leave A Reply