Facebook Instant Articles?


#1

How to integrate CleverTap with Facebook Instant Articles?


#2

Here are the Steps to track Facebook Instant Articles on CleverTap:

  • Make sure you have a facebook page + Facebook App ID

  • When publishing an article via FB Instant article, in the article body, inject our JS

<figure class="op-tracker">

<iframe>
<script type="text/javascript">
var clevertap = {event:[], profile:[], account:[], onUserLogin:[], notifications:[]};
clevertap.account.push({"id": "CLEVERTAP_ACCOUNT_ID"});
(function () {
var wzrk = document.createElement('script');
wzrk.type = 'text/javascript';
wzrk.async = true;
wzrk.src = ('https:' == document.location.protocol ? 'https://d2r1yp2w7bby2u.cloudfront.net' : 'http://static.clevertap.com') + '/js/a.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wzrk, s);
})();
</script>
</iframe>
</figure>
  • In the same iframe you can potentially record an event for article viewed.
clevertap.event.push("Product Viewed", {
"Product name":"Casio Chronograph Watch",
"Category":"Mens Accessories",
"Price":59.99,
});
  • Facebook has an ia_document_ js object which has additional parameters (when someone reads an article) if a customer wants to track these as properties of the Article read event.
<figure class="op-tracker">
<iframe>
<script>
// The URL the user shared
var urlSharedByUser = ia_document.shareURL;
// The article title
var title = ia_document.title;
// Referrer is always set to 'ia.facebook.com'
var referrer = ia_document.referrer;
</script>
</iframe> </figure>

Reference doc: https://developers.facebook.com/docs/instant-articles/analytics#analytics-services