Flash content tracking
Tracking clicks in Adobe Flash content is easily achievable with the Oracle Eloqua asynchronous tracking scripts. The package you receive from Oracle Eloqua should have a Flash sample in it to help you out. The method used in that sample is outlined below:
Supposing you had a button in your Flash content you want to track, in your click handler, you would add the following code (replacing the parameter values with your own):
ActionScript 2:
on (release) {
// your button click handling code
elqTrackFlashClick('http://example.com/content/FlashButton1', 'http://http://example.com/content/referrer');
}
ActionScript 3:
import flash.external.ExternalInterface;
button_1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event: MouseEvent): void
{
// your button click handling code
ExternalInterface.call("elqTrackFlashClick ('http://example.com/content/FlashButton1', 'http://http:/example.com/content/referrer')");
}
where "button_1" is the name of your button.
On your page that hosts the flash object, add the elqTrackFlashClick
JavaScript function in the head section below the standard tracking scripts:
<script type='text/javascript'>
function elqTrackFlashClick(URL, referrer) {
_elqQ.push(['elqTrackPageView', URL, referrer]);
}
</script>
Putting it all together, your page hosting the Flash content might look like this:
<html>
<head>
<script type="text/javascript">
var _elqQ = _elqQ || [];
_elqQ.push(['elqSetSiteId', '<siteID>']);
_elqQ.push(['elqTrackPageView']);
(function() {
function async_load() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//img.en25.com/i/elqCfg.min.js';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
}
if (window.addEventListener) window.addEventListener('DOMContentLoaded',
async_load, false);
else if (window.attachEvent) window.attachEvent('onload',
async_load);
})();
function elqTrackFlashClick(URL, referrer) {
_elqQ.push(['elqTrackPageView', URL, referrer]);
}
</script>
</head>
<body>
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="FlashExample" align="middle">
<param name="movie" value="FlashExample.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="FlashExample.swf" width="550" height="400">
<param name="movie" value="FlashExample.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/
download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>