Skip to content

Instantly share code, notes, and snippets.

@yllus
Last active April 5, 2016 18:29
Show Gist options
  • Select an option

  • Save yllus/a58cc7878e46fd6fefc71d783833b4bc to your computer and use it in GitHub Desktop.

Select an option

Save yllus/a58cc7878e46fd6fefc71d783833b4bc to your computer and use it in GitHub Desktop.

To get back an XML document containing the "VAST2" ad response, call the URL provided in the video feed's JSON data at meta->url_vast2 ( http://www.cfl.ca/?feed=feed-youi-videos&page[number]=1&page[size]=20 ), which will look like:

https://pubads.g.doubleclick.net/gampad/ads?sz=1280x720&iu=/103711331/CFL_Mobile_App_Video&cust_params=[key_values]&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&correlator=[timestamp]

A few quick notes:

  • The string "[ad_category_params]" (without quotes) needs to be URL encoded (see https://support.google.com/dfp_premium/answer/1080597 ). It should have the form of app_section=val, and where val is should be the name of the Video Category of the video being viewed. Some examples:
    • app_section%3D103rd%20Grey%20Cup
    • app_section%3D2015%20Game%20Recaps
    • app_section%3D%23KegSize%20Plays%20of%20the%20Week

And so on (I pulled those Video Category names from the feed at http://www.cfl.ca/?feed=feed-youi-videocategories ).

  • The string "[timestamp]" (without quotes) should be swapped out before being called with the current UNIX timestamp; this is to keep all calls unique/un-cached.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment