In order to create an HTML/JavaScript ad unit which can be served without additional setup by Eyereturn, you must implement Eyereturn's eyeBuild class in your code. This will enable the file to communicate and interact with Eyereturn's ad server. eyeBuild contains the basic functionality required for most ads, with methods to be called on basic user interactions such as click, close, and tracking events. Successful eyeBuild calls will log messages to the JavaScript console of your web browser, so check the console while testing to confirm your code is working correctly.

If using Google Web Designer, be sure to set up your project for the "Non-Google Ad" environment. This will generate functions for interactions to which eyeBuild functionality can be added. eyeBuild cannot be added if a GWD project is exported for the Google-specific environments. Also, do not select the publish option to "minify" code, as this further interferes with the ability to make modifications or fixes.

IMPORTANT! eyeBuild cannot be used for files that Eyereturn is not serving (ie – most CPC placements)

Importing & Initializing eyeBuild

eyeBuild is a JavaScript library that integrates the ad with Eyereturn’s ad tracking system. In all HTML files that require the use of Eyereturn tracking, eyeBuild_x_y.js needs to be included.

The current version is:



In the html file that requires Eyereturn tracking, include the eyeBuild js:

<script type="text/javascript" src="https://quickresource.eyereturn.com/eyebuild/eyebuild_1_19.js"></script>

You need to include the js file in all files that require Eyereturn tracking. Before calling any tracking methods, call:


If your document has a function that is executed when the unit has loaded, the initialize call should be included in that function. If you are unsure where to place this call, you may also place it in an empty script tag, as seen below:

<script type="text/javascript">

Note: initialize() only needs to be called once. If multiple files include the eyeBuild js, call initialize() before the first use of any eyeBuild methods.


These are the available methods of the eyeBuild class, and instructions on their use. The first two, initialize and doClick, should be present and functional in every ad unit. Successful eyeBuild calls will log messages to the JavaScript console of your web browser, so check the console while testing to confirm your code is working correctly. The correct place to implement these calls will differ based on how you have developed your unit, and which software you've used.

eyeBuild.initialize() Initializes eyeBuild. This must be called upon load and initialization of the ad unit, and before using any methods of eyeBuild.
eyeBuild.doClick(n, val1, val2, val3, redirURL)

  • n – clicktag ID number
    (default value is 0)
  • val1, val2, val3, redirURL
    (optional, used only for dynamic clickthroughs - see instructions)
Clickthrough Wherever you handle the clickthrough event, call the doClick method. If your ad has multiple clickthrough destinations, pass the ID number of the click as a parameter to the doClick call. The default clickthrough ID is 0, therefore additional clickthroughs begin at 1. Be sure to make your contact at Eyereturn aware of which URLs correspond to each clickthrough IDs, as they will be responsible for ensuring the URLs are called by the appropriate click events.

Note: For almost all standard ads, n is the only parameter needed. Eg eyeBuild.doClick(0) invokes clicktag 0.

Dynamic Clickthrough Some clickthroughs need to be dynamically constructed, including variables from the ad unit as part the destination. In these cases, you may pass up to three strings as optional arguments to the doClick method.

For example, imagine that your ad unit features ten cars, each a different colour, and a mix of car models. All the cars are clickable to the same destination, but you need the colour of the car clicked included in the query string in order to affect which version appears on landing page.


To accomplish this, all of the clicked cars should make slightly different doClick calls. Specifically, the Black Sedan indicated by the above URL would be called as follows:

eyeBuild.doClick(0, "Black", "Sedan", "None");

Provide your contact at Eyereturn with instructions on how to construct the URL from the variables passed. In this case, they would need to know that the clickthrough needs to be constructed as follows:


  • i – the IAT number.
Event Tracking - If your ad unit requires tracking of content specific interactions (ie: a replay button, or the tracking of transport controls in a video unit), you must implement a doIAT() call when the event occurs. Each call requires a corresponding ID to be passed as an argument to the call.

The following are the standard IATs for the most common tracking events. Implement these wherever applicable in your ad unit. For events not covered here, use the doCustomIAT() method as described in the next section.
Play eyeBuild.doIAT(0);
Pause eyeBuild.doIAT(1);
Stop eyeBuild.doIAT(2);
Mute eyeBuild.doIAT(3);
Unmute eyeBuild.doIAT(4);
Video Start eyeBuild.doIAT(5);
25% View eyeBuild.doIAT(6);
50% View eyeBuild.doIAT(7);
75% View eyeBuild.doIAT(8);
100% View eyeBuild.doIAT(9);
Replay eyeBuild.doIAT(10);
Rollover to Expand eyeBuild.doIAT(11);
Click to Expand eyeBuild.doIAT(12);
Click to Play eyeBuild.doIAT(13);
Click to Continue eyeBuild.doIAT(14);
Next eyeBuild.doIAT(15);
Previous eyeBuild.doIAT(16);
Back eyeBuild.doIAT(17);
Submit eyeBuild.doIAT(18);

  • i – the custom IAT number.
    (i ranges from 0 to 149)
Custom Event Tracking - For unique events not covered in the previous section, the doCustomIAT() method allows you to create up to 100 of your own tracking events, which will appear in reporting with the names of your choosing. First, create a list of the events you wish to track with the event name to be displayed in reporting, and a corresponding ID number, starting from 0 and incrementing for each new event. You will need to provide this list to your Eyereturn contact upon delivery of the ad unit.

Feel free to use both standard doIAT() and custom doCustomIAT() tracking events in the same unit as required, but for continuity in reporting we prefer that the pre-defined doIAT() calls are used wherever applicable. For instance, we would advise against creating a custom event for "Send" where the "Submit" event doIAT(18) would suffice.

  • pixel – the url of the pixel.
Drops an image pixel.

  • pixel – the url of the pixel.
Drops a script pixel.
eyeBuild.doOpen() Used to display the expanded portion of an expanding ad unit. Only click-to-expand banners require a doOpen call; the more common rollover-to-expand configuration does not require a doOpen call, or any code to detect the user's rollover. All expanded files require a close button with the doClose call.
eyeBuild.doClose() Used to close an ad unit. Necessary in the expanded portions of expanded ad units, in vokens, etc.