Skip to content

Instantly share code, notes, and snippets.

@stursby
Last active June 22, 2023 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stursby/f92c3c079f307e37f73a0264b726cd9b to your computer and use it in GitHub Desktop.
Save stursby/f92c3c079f307e37f73a0264b726cd9b to your computer and use it in GitHub Desktop.
The Trade Desk + Google Web Designer clickTAG Instructions
  1. Drag a new Tap Area component into the scene and make sure it’s on the top layer.
  2. Resize the layer to match the banner dimentions and rename it tradeDeskClickTag. (After setup is done, you can hide and lock this layer)
  3. Right click the Tap Area and select Add Event. Next, under the Tap Area dropdown, select Touch/Click.
  4. In the Action section, under the Custom dropdown, select the Add custom action.
  5. Name the function clickEvent and the paste the following JavaScript code in the textarea:
window.open(window.clickTAG)
Example custom actionimage
  1. Finally, enter the "Code View" mode and paste the following JavaScript snippet right before the close </head> tag:
<script type="text/javascript" charset="utf-8">
  function getParameterByName(name) {
    name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]')
    var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'),
      results = regex.exec(location.search)
    return results === null
      ? ''
      : decodeURIComponent(results[1].replace(/\+/g, ' '))
  }
  var clickTAG = getParameterByName('clickTAG')
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment