Facebook Instant Articles
Instructions to add Chartbeat code to your Facebook Instant Article pages.

Intro to Facebook Instant Articles

Chartbeat tracking for Facebook Instant Articles is a feature included in all customer plans.
Facebook's Instant Articles are HTML documents optimized for fast mobile performance within the Facebook mobile app. Upon integrating Chartbeat code on these pages, a new filter labeled 'Facebook IA' will appear under the Distribution module in your Real-Time Dashboard, displaying real-time traffic data for all visitors to your instant article pages.

Validate your existing FIA HTML

Make sure that your site's Instant Articles are properly configured according to Facebook's HTML specification. Your Instant Articles should also be validated using Facebook IA's Page Manager.

Insert our tracking code

Insert the following code snippet in the <body> of your page HTML:
<figure class="op-tracker">
<script type='text/javascript'>
(function() {
var _sf_async_config = window._sf_async_config = (window._sf_async_config || {});
_sf_async_config.uid = #####; //CHANGE THIS TO YOUR ACCOUNT ID
_sf_async_config.domain = 'domain.com'; //CHANGE THIS TO YOUR SITE ID
_sf_async_config.sections = ''; //SET PAGE SECTION(S)
_sf_async_config.authors = ''; //SET PAGE AUTHOR(S)
_sf_async_config.path = ''; //SET PAGE CANONICAL URL
_sf_async_config.title = ''; //SET PAGE TITLE
<script defer src="//static.chartbeat.com/js/chartbeat_fia.js"></script>
The uid and domain configuration variables in the above snippet should be assigned to your Chartbeat account id and site id, respectively.
Section, author, path, and page title variables should be populated by your Facebook IA feed CMS with page metadata that matches precisely the metadata sent from your standard website. If the Chartbeat code on your website utilizes our useCanonical and useCanonicalDomain settings for our tracker to collect the canonical URL from your page HTML, your Facebook IA Chartbeat code should send the same canonical URL via the path configuration variable. For example, if an article's canonical URL is https://mysite.com/news/article-xyz.html, the path variable should be populated as follows in that page's Facebook Instant Article HTML:
_sf_async_config.path = 'mysite.com/news/article-xyz.html';
Tip: if your website integration utilizes our optional content type and/or sponsor name configuration variables to send additional page metadata, these variables can also be added to the Chartbeat code in your Facebook Instant Articles.


Chartbeat video tracking for Instant Article pages is unsupported at this time.

QA steps

Upon a successful Chartbeat integration with your Instant Article pages, a new Facebook IA filter will appear in the left-hand side of your Real-Time Dashboard (screenshot below).
FIA filter in Real-Time Dashboard
Select the Facebook IA filter in your Real-Time Dashboard to perform the following data QA checks:

Under 'Top Pages':

    Page titles are populating as expected
    Hover over page titles in this list to view the canonical paths received from these pages. Alternatively, click into the article view and right-click the title to copy the link address
    Check for duplicate page entries in this list, and identify the discrepant paths being received from these pages to determine the fix in your configuration settings
    Open the section & author drop-down filters to ensure section & author data is populating as expected
Tip: The page property metadata (sections, authors, path, title, and content type) configured to send from your FIA pages should match exactly the data we receive from those same pages on your standard website via our standard JavaScript tag, and stay consistent across all of your other Chartbeat tracked platforms. Check to ensure the page data being sent from your Instant Articles to Chartbeat aligns precisely with the data we receive from those same pages across your other Chartbeat-tracked platforms.
Last modified 7mo ago