Subscribe for notification
Categories: Facebook

2 Ways Add Facebook IA with Google Analytics

Hi developers, In this tutorial, you will learn how to add Facebook Instant Article with Google Analytic tracking code with customization. Facebook instant article store your website post content and displayed from its own server , resulting in the tracking of page views for Google analytic. But in this How to track Facebook instant article with Google analytic tutorial you will learn to customize your analytic tracking code for your Facebook instant article, so start following the below steps to track your website page views even on Facebook instant articles using Google analytic tracking code.

The above code does four main things:

  • Creates a <script> element that starts asynchronously downloading the analytics.js JavaScript library from https://www.google-analytics.com/analytics.js
  • Initializes a global ga function (called the ga() command queue) that allows you to schedule commands to be run once the analytics.js library is loaded and ready to go.
  • Adds a command to the ga() command queue to create a new tracker object for the property specified via the ‘UA-XXXXX-Y’ parameter.
  • Adds another command to the ga() command queue to send a pageview to Google Analytics for the current page.

Facebook IA with Google Analytics

Facebook IA with Google Analytics
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->

Note: Instead of UA-XXXXX-Y add your own Google analytic ID

This post was last modified on August 8, 2020 3:59 am

Sponsored
SyncSaS

SyncSaS Technologies is specialized in creating and designing customized software. We have our own team that will be in charge of developing your softwares.

Share
Published by

Recent Posts

Adsense Updated Dashboard

Changes in Adsense Dashboard Recently you might have seen few changes in Adsense dashboard, these…

4 weeks ago

Guide Book For Google Adsense

With my experience in working as AdSense publisher, I have written many articles, tutorials for…

4 weeks ago

How to manage Google Adsense to get High CPC

Manage Adsense for High CPC CPC (Cost per click) in simple words the CPC is…

4 weeks ago

Google Adsense Introduce page level ads

If you are already the publisher of Google Adsense account then now its time to…

4 weeks ago