Chartbeat Tracking for SmartNews

Instructions to track SmartNews' "SmartView First" formatted content in your Chartbeat account with our beta integration.

Intro to SmartNews

SmartNews is a news aggregation app that allows its publisher partners multiple display formats for their articles within the app. Publishers participating in SmartNews' SmartView First native format program have the option to include external analytics code (Chartbeat, Google Analytics, etc) in their SmartFormat v2.0+ feeds. If your organization uses this SmartView First native display format for your articles in SmartNews, Chartbeat will only track engagement on those pages if our code is added to your SmartFormat feed following the instructions below.

If your organization uses SmartNews' standard web view format, Chartbeat code cannot be added directly to your SmartFormat v1.1.4 feed as outlined below — this integration is only supported for SmartFormat feeds version 2.0 and above. Instead, readers of your content in the SmartNews app will open a web view version of your page which should already include our standard website tracking or AMP code for your mobile-web pages, and Chartbeat tracking for your SmartNews audience should occur automatically as SmartNews referred in your website's primary Real-time Dashboard under the 'Links' traffic source category.

Setting up a SmartNews Chartbeat Beta Dashboard

We currently require that your SmartView First traffic data belong to a separate Chartbeat Site (dashboard) from your website's primary Real-Time Dashboard. We do not support engaged time tracking for this integration yet, so we insist that all SmartView engagement data appear in SmartNews-only Chartbeat dashboards to prevent deflating average engaged time numbers in your website's primary Chartbeat Site.

Your Chartbeat Customer Success representative or Implementation Engineer can assist with creating a new Site on your Chartbeat account using the following format: yourdomainname.smartnews. For example, if my website is bigcitypaper.com, my Chartbeat SmartNews Site should be called bigcitypaper.smartnews.

Add our tracking code to your SmartFormat feed

To start tracking SmartView First traffic, you will need to add Chartbeat tracking code to the SmartFormat feed. This can be done by inserting our code snippet to a <snf:analytics> tag as seen below:

<snf:analytics>
    <script type='text/javascript'>
        (function() {
            /** CONFIGURATION START **/
            var _sf_async_config = window._sf_async_config = (window._sf_async_config || {});
            _sf_async_config.uid = #####; //CHANGE THIS
            _sf_async_config.domain = 'yourdomain.smartnews'; //CHANGE THIS
            _sf_async_config.path = ''; //SET PAGE CANONICAL URL
            _sf_async_config.title = ''; //SET PAGE TITLE
            _sf_async_config.sections = ''; //CHANGE THIS TO YOUR SECTION NAME(s)
            _sf_async_config.authors = ''; //CHANGE THIS TO YOUR AUTHOR NAME(s)
            /** CONFIGURATION END **/
            function loadChartbeat() {
                var e = document.createElement('script');
                var n = document.getElementsByTagName('script')[0];
                e.type = 'text/javascript';
                e.async = true;
                e.src = '//static.chartbeat.com/js/chartbeat.js';
                n.parentNode.insertBefore(e, n);
            }
            loadChartbeat();
         })();
    </script>
</snf:analytics>

The uid configuration variable in the above snippet should be assigned to your Chartbeat account id. The domain configuration variable should be assigned to your SmartNews-Chartbeat Site id, in the format of yourdomainname.smartnews.

Section, author, and title variables should be populated by your SmartFormat feed generator with page metadata that matches precisely the page metadata sent from your standard website. Similarly, 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 SmartNews 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 SmartFormat RSS:

_sf_async_config.path = 'mysite.com/news/article-xyz.html';

Important: If adding multiple analytics scripts to the SmartFormat feed, ensure these scripts are all enclosed in a single<snf:analytics> tag, but separate <script> tags.

Limitations

While this integration is still in beta, engaged time and recirculation metrics cannot be measured for your SmartNews app audience.

Last updated