Publisher API: SubID Tracking Implementation

  • In order to use SubID tracking, you must have a 3rd party API software. We recommend Postman which is entirely free. Postman will be used as the basis for further instruction.
  • Revcontent API: https://api.revcontent.io/docs/stats

Please contact your rep to ensure you have access to the Revcontent API.


Adding SubID Tracking to Your Standard & API Widgets

 
Standard Widget Example

 
<div id="rcjsload_03d3cb"></div> <script type="text/javascript"> (function() { var referer="";try{if(referer=document.referrer,"undefined"==typeof referer)throw"undefined"}catch(exception){referer=document.location.href,(""==referer||"undefined"==typeof referer)&&(referer=document.URL)}referer=referer.substr(0,700); var rcel = document.createElement("script"); rcel.id = 'rc_' + Math.floor(Math.random() * 1000); rcel.type = 'text/javascript'; rcel.src = "http://trends.revcontent.com/serve.js.php?revsub[KEY]=VALUE&w=4384&t="+rcel.id+"&c="+(new Date()).getTime()+"&width="+(window.outerWidth || document.documentElement.clientWidth)+"&referer="+referer; rcel.async = true; var rcds = document.getElementById("rcjsload_03d3cb"); rcds.appendChild(rcel); })(); </script>


API Widget Example: (Publisher to fill in API Key, Pub ID, Widget ID, ect.)
API Widget Example

 
https://trends.revcontent.com/api/v1/?revsub[KEY]=VALUE&api_key=3eeb00d786e9a77bbd630595ae0be7e9aa7aff3b&pub_id=945&widget_id&#61;396&domain=powr.com&sponsored_count=5&sponsored_offset=0


NOTES: 
  • SubID values should be URL-encoded into valid ASCII format to ensure you do not break the URL.
     
  • You can add multiple values to the revsub array.
    • Example: "revsub[KEY1]=VALUE1&revsub[KEY2]=VALUE2"
    • Note: Each key must be unique.
       
  • You can also attach multiple values to a single key.
    • Example: “revsub[KEY]=VALUE1,VALUE2,VALUE3”
      • Reporting will show all of the values combined together under that unique key.
         
  • Because of URL length limitations in IE 8 and less, strive to keep your revsub array under 100 characters.
     
Recommended Uses for SubID Tracking
  • SubID tracking is an extremely useful tool that can be customized to meet your needs. Publishers successfully use this to track revenue by geo, article, source of traffic, and social influencer. This can be also be an extremely valuable tool to evaluate performance of different page variations you are testing out for your site.

     
SubID Ad Code Example

 
<div id="rcjsload_03d3cb"></div> <script type="text/javascript"> (function() { var headline = document.getElementById("headline").innerHTML; var referer="";try{if(referer=document.referrer,"undefined"==typeof referer)throw"undefined"}catch(exception) {referer=document.location.href,(""==referer||"undefined"==typeof referer)&&(referer=document.URL)}referer=referer.substr(0,700); var rcel = document.createElement("script"); rcel.id = 'rc_' + Math.floor(Math.random() * 1000); rcel.type = 'text/javascript'; rcel.src = "http://trends.revcontent.com/serve.js.php?revsub[headlines]="+headline+"&w=4384&t="+rcel.id+"&c="+(new Date()).getTime()+"&width="+(window.outerWidth || document.documentElement.clientWidth)+"&referer="+referer; rcel.async = true; var rcds = document.getElementById("rcjsload_03d3cb"); rcds.appendChild(rcel); })(); </script>

 
  •  In this example, the developer has coded the headline value to be automatically detected based on the URL. SubID stats will now appear broken out by article headline.


Locate Your API Credentials
  • When logged into your account, go to your Account Settings; your client id and client secret can be found at the bottom of the page.


Get Your Access Token
  1. Open Postman and click the button to add a new collection.
  2. Use a POST call with URL pulled from the Revcontent API doc (https://api.revcontent.io/oauth/token)
    Type: “No Auth”
Navigate to the Headers Tab
  •     Key: Content-type
  •     Value: application/x-www-form-urlencoded
Navigate to the Body Tab
  •     Change radio button “x-www-form-urlencoded”
  •     Key1: grant_type
  •     Value1: client_credentials
  •     Key2: client_id
  •     Value2: Enter the Client Id Found in Your Account Settings
  •     Key3: client_secret
  •     Value3: Enter the Client Secret Found in Your Account Settings
Save to Collection You Created in Step 1
Send
You will now see your access token within the body section at the bottom of the page. Copy and save it. This access token will be valid for 24 hours.


Get SubID Stats
Hit the + to open a new tab.
  1.     Use a GET call with URL pulled from the Revcontent API doc (https://api.revcontent.io/stats/api/v1.0/widgets/:widget_id/revsub).

    Click “Params” button to enable a drop down. Enter the widget id you are pulling SubID stats for in the value section next to “widget_id”.
  • Key2: date
  • Value2: Date of statistics in Y-m-d format.
  • Key3: limit
  • Value3: Number of records to return. Max 1000. Defaults to 1000.
  • Key4: offset
  • Value4: Offset for the records to return. Defaults to 0.
  • Type: “No Auth”
Navigate to the Headers Tab
  •     Key1: Authorization
  •     Value1: Bearer {access token}
  •     (Paste in the Access Token You Created in “Get Your Access Token”)
  •     Key2: Content-type
  •     Value2: application/json
Save to Collection You Created in Step 1
Send
Within the Body section, you will now see URL(s) that can be pasted into any internet browser to initiate a download of your SubID stats.