Widget API

The Widget URL API is a set of options that enable you to control widget features and callbacks.

Usage

http[s]://api.virool.com/widgets/[siteKey]?[widgetQuery]

siteKey - You have to specify your sitekey. To get a sitekey, you need to create a site on the ‘My Sites’ page: http://virool.com/sites

Example: http://api.virool.com/widgets/44fe67f

Widget Query Parameters

The table below lists the parameters that widget query supports. All of the parameters listed are query parameters.

Param Type Details
cid Number ID of Virool ad campaign. If specified, the widget will show a specific campaign. If not specified, the widget will load in “auto-widget” mode. NOTE: if the specific campaign is not active, your views will not be billed!
suid Number Your site's user ID. This user ID will be included in the callback. If not specified, the Virool user ID will be used.
width Number Widget width in pixels. (default: 640)
height Number Widget height in pixels. (default: 400)
min_reward Number In auto-widget mode, this param will filter offers with a reward that is higher than the specifed amount in cents.
pxtrackback String Your trackback pixel URL. We will show it as soon as user watches 15-25 seconds of the video. Link must be URL-encoded.
oncompleted String Your completion of the postback URL. We will notify you with this URL as soon as we process the user’s view and accept it (about 30 seconds after the user hits the play button). A notification request will be sent from our servers (along with your site callback URL). The link must be URL-encoded.
nologo 1 or 0 When 1, removes Virool logo from widget. (default: 0)
without_next 1 or 0 When 1, widget will not show “next video” button after 30 seconds of video played. (default: 0)
autoswitch 1 or 0 When 1 and the campaign ID is provided, this param turns the specific promotion widget into an auto-widget if the specified campaign has been completed. (default: 0)
strict 1 or 0 When 1 and the campaign ID is provided, the widget will not load campaign contents if the user already watched that video in the last 24 hours or if the campaign has been completed. (default: 0)
show_loading 1 or 0 When 0, the widget will not show the loading overlay with the spinner above the video when it is loading. (default: 1)
filter_autoplay 1 or 0 When 1, the widget will show only auto-play campaigns. When 0, the widget will show only click-to-play campaigns.

Examples

Basic iframe embed code

<iframe src='//api.virool.com/widgets/1869e2b94553ce24b6da81aac6db471e?width=640&height=400' 
width='640' height='400' allowfullscreen marginwidth='0' marginheight='0' frameborder='0' scrolling='no'></iframe>

Basic javascript embed code

<script src='//api.virool.com/widgets/1869e2b94553ce24b6da81aac6db471e?width=640&height=400&format=js' type='text/javascript'></script>

Javascript embed code extended by additional window variable with widget params

<script type='text/javascript'>
  window.viroolWidgetParams = {
    cid: 18526
  };
</script>
<script src='//api.virool.com/widgets/1869e2b94553ce24b6da81aac6db471e?width=640&height=400&format=js' type='text/javascript'></script>