Build an HTML5 AppNexus Creative in Google Web Designer
This page explains how to use Google Web Designer to build HTML5 creatives that will properly track clicks in AppNexus.
- From within Google Web Designer, click the + button under Events to add a new event.
- Add an Event Target
Choose the element of the ad that will be clickable.
- Select Event.
Then choose the user action that will open the landing page (e.g., click)
- Select Custom under Action.
- Type a unique name into the field (next to gwd.) provided (e.g., appnexusClick). Then paste the code below into the text box provided (this is your clickTag code).
function getParameterByName(name) {
var match = RegExp('[?&]’ + name + '=([^&]*)’).exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ’ ’));
}
window.open(getParameterByName(’clickTag’), '_blank’);
Paste the code using your computer’s menu bar as Google Web Designer has a known issue with key commands. - Then click OK.
- Test (optional)
Click Preview to open the ad in your browser. Add ?clickTag=http://yoururlhere.com at the of the URL in the address bar with the landing page you want to test. Refresh the page and click on the ad. A new window with the landing page you entered should open in your browser. When the ad is served, AppNexus sets the value of clickTag to AppNexus’ click tracker and set a redirect to the landing page URL provided in Console.
Source: https://wiki.appnexus.com