Facebook Instant Articles?


How to integrate CleverTap with Facebook Instant Articles?


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">

<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);
  • 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",
  • 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">
// 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;
</iframe> </figure>

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