• Resolved whitehat123

    (@whitehat123)


    Hello.
    I am facing problem with Google Analytics.It does not monitoring traffic of Instant articles.
    Please share the code format to put in analytics.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author shawfactor

    (@shawfactor)

    this gives you a good explanation,

    https://developers.facebook.com/docs/instant-articles/analytics/

    my pklugin will encloe everything you put in the tracking code field with:

    ‘<figure class=”op-tracker”> and </figure> so you need to include the iframe and the rest of the code, whatever that is.

    Thread Starter whitehat123

    (@whitehat123)

    I paste this code and save.

    <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&#8217;,’ga’);

    ga(‘create’, ‘YOUR_UID_REPLACE_THIS’, ‘auto’);
    ga(‘require’, ‘displayfeatures’);
    ga(‘set’, ‘campaignSource’, ‘Facebook’);
    ga(‘set’, ‘campaignMedium’, ‘Social Instant Article’);
    ga(‘set’, ‘title’, ia_document.title);
    ga(‘send’, ‘pageview’);

    </script>

    After it got saved it looks like below:

    <iframe><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-Xxxx\’, \’auto\’);
    ga(\’require\’, \’displayfeatures\’);
    ga(\’set\’, \’campaignSource\’, \’Facebook\’);
    ga(\’set\’, \’campaignMedium\’, \’Social Instant Article\’);
    ga(\’set\’, \’title\’, \’FBIA: \’+ia_document.title);
    ga(\’send\’, \’pageview\’);

    </script> </iframe>

    Thread Starter whitehat123

    (@whitehat123)

    I also put <iframe> </iframe>tags

    Plugin Author shawfactor

    (@shawfactor)

    This is something yur server is doing in its handling of posted quoted text. This is not an issue with my plugin. You would see similar issues when inputting similarly quoted strings elsewhere

    Thread Starter whitehat123

    (@whitehat123)

    This code is working fine with other plugin s.So , this is not caused by server.

    Plugin Author shawfactor

    (@shawfactor)

    Look the problems does exist at your end as the code works fine on my sites: if you indicate another pkugin that handles this properly I see if I can find a solution for both. But bear in mind there a myriad of reasons plugins dont work and without looking at your setup it is really hard to tell

    Plugin Author shawfactor

    (@shawfactor)

    I am resolving this for good order. I will rcontinue to minitor the thread so feel free to repost and I wil re open it if required.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Google Analytics code not working’ is closed to new replies.