The analytics box is a free form textarea, meaning you can add as many or as few analytics scripts as you like. They will automatically be wrapped in a <figure class="op-tracker"> tag to make them compatible for Instant Articles.

Google Analytics

You can use the code to add Google Analytics to your Instant Articles. Don't forget to replace YOUR-ANALYTICS-ID with your actual Google Analytics ID

(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
ga('create', 'YOUR-ANALYTICS-ID', 'auto');
ga('require', 'displayfeatures');
ga('set', 'campaignSource', 'Facebook');
ga('set', 'campaignMedium', 'Social Instant Article');
ga('send', 'pageview', {title: ia_document.title});

Analytics Custom Post Dimensions

As of v1.3.4 you can now use certain post placeholders in your Analytics code.

For example, if you wanted to associated posts with your authors in Google Analytics and you'd set it up as dimension, you could add the following code to your Google Analytics.

ga('set', 'dimension1', '{post_author_id}');

Analytics Placeholders


Still need help? Contact Us Contact Us