0

Instant Articles are configured a couple of months back. We have close to 300+ articles. Everything is working fine as long as Instant Articles is concerned.

I was not aware of the fact that GA doesn't track the page views from Instant Articles. I followed this https://stackoverflow.com/a/38112027/2657566 and added Global Site Tag.

This is my code. After saving it from Wordpress Instant Article Plugin's interface, when I open the Instant Article from my mobile, I dont see any active users.

Can you please let me know if am missing anything. Thanks in advance.

<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-XXXXXXXXX-X', 'auto');
  ga('set', 'campaignSource', 'Facebook');
  ga('set', 'campaignMedium', 'Facebook Instant Articles');
  ga('set', 'referrer', ia_document.referrer);
  ga('send', 'pageview');

</script>
Krishna Teja Karnam
  • 133
  • 1
  • 3
  • 14

1 Answers1

0

Remove https:// and make sure the url is like this(if you’d ridge is not serving https requests) //www.google-analytics.com/analytics.js.

Krishna Teja Karnam
  • 133
  • 1
  • 3
  • 14