Skip to content

Instantly share code, notes, and snippets.

@stuartphilp
Created January 30, 2014 16:24
Show Gist options
  • Save stuartphilp/8712421 to your computer and use it in GitHub Desktop.
Save stuartphilp/8712421 to your computer and use it in GitHub Desktop.
correlator = ->
Math.floor (Math.random() * 10000000000000000)
module.exports = new class DFP
request: ({id, size, targets}, callback) =>
counter = counter + 1
data =
# These field names and values have been determined by reverse engineering
# requests made from Google's official GPT library. (The GPT library
# cannot be used directly because it places all ad units in iframes.)
gdfp_req:1
correlator: correlator()
output: "json_html"
iu:id
sz:size
gut:"v2"
ifi:counter
json_a: 1
url: window.location.href
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment