The Revcontent API enables you to receive the same ad fill you would see in our traditional ad placements in a more flexible format, json or XML. API usage requires Full Advertising Disclosure. API requests can be in either JSON or XML format.

URI / Endpoint

Content-Type application/json or text/xml

GET http://push.stackie.com/api/v2/

*Properties in red are required
 

Example

JSON

#JSONP var script = document.createElement('script'); script.src = 'http://push.stackie.com/api/v2/?api_key=your_api_key&pub_id=111&widget_id=222&domain=yourdomain.com&user_ip=71.100.91.34&referer=www.revcontent.com&format=json&sponsored_count=25&sponsored_offset=0&internal_count=3&internal_offset=2&callback=my_callback&tracking=manual&pick_one=1';; document.body.appendChild(script);

Response

The expected response values in the return payload are shown below.

Example

JSON

[ { "impression":"CGX0eStWi7jzeDMY5ovjO5cIxisjGeS5podquxKFp%2FwtGhttHpV3XYWKc1HdMoNOYP3ML6PtQlCtYx7r%2BPJTIjMQRDEppgtmZbaSYdPwwrL1uSGJE2Ud62NA1jAeAueyYH%2BdHfFjctFzyp...", "brand": "Trending Solutions", "headline": "20 Mind-Blowing Facts You Didn't Know", "image": "//img.revcontent.com/?url=https://revcontent-production.s3.amazonaws.com/content/images/1430757674.jpg&pos=face&h=315&w=420", "url": "//trends.revcontent.com/click.php?d=eJwVk8kVxDAIQ1tiMVs5GEz%2FJYSc5mWwsZA%2BRaQQl1ztRMQNj2nKAxGiKOivuueBPbmY8t", "type": "sponsored", "content_type": "article", "uid": "sponsored_248" }, ... ]         


Viewability
Views must be tracked. A view occurs when a widget or new creative comes into the users viewport.
 
Viewed Parameter
The viewed parameter allows a request to be made that will register a view for the widget and creatives within the limit and offset. Pass viewed=true to track views for a widget and its creatives. Pass empty=true as well if impressions should be ignored. This will track a view for entire widget. To record a view for specific widget and/or adset, you will need to use the view link parameter that is returned in the response for each widget. The view link parameter accepts 2 additional params (referer, url encoded and an array of which creative spots are viewed: ex first three ads: p[]=0&p[]=1&p[]=2
 
Advanced Usage
For more advanced implementations widget and creative impressions must be managed. The API provides helper parameters for common use cases.
 
Empty Parameter

The empty parameter allows a request to be made without registering either widget or creative impressions. Pass empty=true to return a response without registering any impressions.
 
Fill Parameter and offset rule
Sometimes it is necessary to only register creative impressions while ignoring the widget impression. If either the sponsored_offset or trending_offset is greater than 0 the system will automatically only register creative impressions. This behavior can be forced by using the fill param passing fill=true
 
Tracking Parameter
Default is auto. If manual is passed, it will NOT record this impression until the impression data is posted back to /v2/track.php passing in field name of “d”. Views can be triggered in the passback as well. Passed in a POST or a GET.
d=long_impression_string
viewed=1 or do not send viewed at all.
 
Impression Tracking
When calling the API using a GET call with tracking parameter set to manual (tracking=manual), you are also able to pass a parameter (pick_one=1). If pick_one is set, content will get a new property attached referred to as “impression”. Users are able to use this as an impression tracking pixel when calling the track.php call. This enables a user to trigger an impression on a certain piece of content. Each content and subsequent click link would be position =1.

Did this answer your question?