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
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.
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.
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.
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.
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.
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.