Documentation

Event tracking

The Rich Agent automatically tracks mouse overs, mouse exits and clicks. These events are the basis for the “engagement” metric in Rich.

The Rich agent is currently not capable of knowing if a click is the ad’s click-through, so to get good click-through statistics you will need to help out by sending a custom event from the event handler that triggers click-through.

If your ad is interactive you may want to track events besides click-through. If your ad contains a game you might want to know how many clicked the “start game” button, or if it contains a video player you might want to know how many clicked “play” and how many watched the movie at least half way through.

Please note that custom event tracking is currently a feature in development. The data doesn’t yet appear in the Rich report, but it may do so in the near future, so implementing this feature is still a good idea. (This does not apply to click-through events, which are included in the report.)

How to track click-through

To make sure that click-throughs are logged you need to send a custom event called “clickThru”. You probably handle click-throughs something like this:

function onRelease( ) {  getURL(_root.clickTAG, "_blank");}

or send a custom event called “clickThru”:

function onRelease( ) { 
  getURL(_root.clickTAG, "_blank");
  RichAgent.trackEvent("clickThru", this);
}

The result will be the same, regardless of which method you choose, and the RichAgent.clickThru function is actually implemented more or less like the second example. The benefit with the first is that you have to do less.

How to track custom events

To log a custom event use the following code:

RichAgent.trackEvent("myCustomEvent", "theNameOfTheObject");

The first parameter is the name of the event, this will show up in the reports, so choose it carefully. The second parameter is the name of the object that the event should be associated with (for example the button or movie clip that was clicked). This value does not currently show up in the reports, but it may do in the future. If you call the code in the context of a movie clip you can pass this as the second parameter, and the agent will try to figure out the name of the object from the name of the movie clip:

RichAgent.trackEvent("myCustomEvent", this);

This variant does not work if you use ActionScript 1 event handlers (on (release)), because in those this refers to _root.

Custom segments

To track custom segments call RichAgent.trackSegment and pass the segment name and value. This can be done at any time, and as many times as needed. If you send different values for the same segment names, only the last value will be recorded.

Example:

RichAgent.trackSegment("interest", "sport");

Usually you would do this either when the ad has just started, or in an event handler that is triggered by some user action.

Even if there currently is no enforced limit on how many different custom segments you can track for a campaign please use this feature judiciously as each extra custom segment increases the load on our number crunchers significantly.