Third Party Click Tracking with OpenX

With OpenX, you can track when users click a third party tag. You can use third party clicking when you load a third party HTML ad into OpenX or when you load OpenX ad code into a third party ad server.

Tracking Clicks Of Third Party Tags In OpenX Statistics

OpenX supports multiple popular third party tags. To track clicks for third party ads, perform the following steps:

  • Select a known third party ad server when you add the HTML banner into the OpenX inventory.
  • Perform some manual changes to the ad code for unknown third party ad servers

NOTE: If your 3rd party tag provider is not on the list move to the 'Unknown third party' chapter below.

Known third party

To track clicks for a known third party:

  1. Paste the HTML for the ad in the Banner Properties tab.
  2. Select the third party from the pull-down menu below the ad HTML as shown in the screenshot.
  3. Save the newly created HTML banner.

Unknown third party

If the tag is from an unknown party, you must perform a manual change to the ad code. The third party will supply a mechanism to track clicks which is, typically, a placeholder in the ad code for the click trackng URL. Replace this placeholder with the magic macro {clickurl}.

Example

Following is an example third party click tracking tag:

<SCRIPT LANGUAGE="JavaScript1.1">
var yctred='[CLICK_TRACKER]';
</SCRIPT>
<SCRIPT language="JavaScript1.1" src="http://report.example.com/cgi-bin
/redflash.cgi/250/;[RANDOM_NUMBER]">
</SCRIPT>
<NOSCRIPT>
<a href="[CLICK_TRACKER]http://report.legalandgeneral.com/cgi-bin
/redshot.cgi/281/mo/ingif/" target="_blank">
<img src="http://report.legalandgeneral.com/cgi-bin/redshot.cgi/281/mo
/ingif/image.gif;[RANDOM_NUMBER]">
</a> 
</NOSCRIPT>

To enable click tracking for this tag, replace [CLICK_TRACKER] part with the OpenX {clickurl} macro. OpenX also recommends that you substitute the {random} macro for [RANDOM_NUMBER] to avoid any issues with client/proxy caching. These changes are made in the following example:

<SCRIPT LANGUAGE="JavaScript1.1">
var yctred='{clickurl}';
</SCRIPT>
<SCRIPT language="JavaScript1.1" src="http://report.example.com/cgi-bin
/redflash.cgi/250/;{random}">
</SCRIPT>
<NOSCRIPT>
<a href="{clickurl}http://report.legalandgeneral.com/cgi-bin
/redshot.cgi/281/mo/ingif/" target="_blank">
<img src="http://report.legalandgeneral.com/cgi-bin/redshot.cgi/281/mo
/ingif/image.gif;{random}">
</a> 
</NOSCRIPT>

Explanation

The {clickurl} and {random} placeholders are simple OpenX Magic Macros. The {clickurl} macro stands for the following example click tracking URL:

http://www.yourwebsite.com/openx/ck.php?oaparams=2__bannerid=1234__zoneid=234__
cb=c6ec93c6d6__oadest=

If you add the {clickurl} macro in front of the banner target URL in the <a href="www.bannertarget.com"> for example: <a href="{clickurl}www.bannertarget.com"> you should get the following result:

<a href="http://www.yourwebsite.com/openx/ck.php?oaparams=2__bannerid=1234__
zoneid=234__cb=c6ec93c6d6__oadest=href=www.bannertarget.com">

NOTE: If you enter the banner destination field in the banner properties tab it will be automatically added after the oadest= parameter.

NOTE: If you are not sure where to exactly place the {clickurl} placeholder or there is no unambiguous code part which should indicate the place you need to contact with your 3rd party tag provider for assistance. They will be able to tell you where to place {clickurl} placeholder.

Tracking clicks for OpenX ads on a third party ad server

When you load tags into an external ad server, OpenX always counts the clicks. However, if you also want to track the clicks in the external system, you must insert the click tracking macro for the external system into the OpenX ad code.

If the tag is for a third party server, to enable click tracking:

  1. In the Invocation Code tab, scroll to the Preferences section underneath the ad code snippet.
  2. Select the server for the known third party from the pull-down menu, as shown in the following screenshot:
  3. Click Refresh to update this preference in the ad code snippet.

OpenX currently provides automatic modification of click tracking macros for three known third parties:

  • Generic inserts the placeholder, "INSERT_CLICKURL_HERE", into the ad code for an unknown third party.
  • Rich Media - Doubleclick inserts "%c" into the ad code for loading OpenX tags into a Doubleclick server.
  • Rich Media - OpenX inserts "{clickurl}" into the ad code for loading OpenX tags into another instance of the OpenX server.

Example

The following screenshot shows example JavaScript ad code before selecting a third party preference:

Note the additional tag on the second line of the ad code, after selecting the generic third party preference: