Home > Tracking Campaigns > CPV Lab Pro

Fire CPVLab tracking pixel onClick (2)


03-22-2013 10:25 PM #1 70degrees (Member)
Fire CPVLab tracking pixel onClick

I want to fire my CPVLab tracking pixel when someone clicks on the download button on my landing page (rather than on the actual Installation Successful page).

Since my CPV lab tracking pixel is an image tag:

<img src="http://domain.com/adclick.php" width="1" height="1" border="0" />

Am I right in thinking I that I’d have to create some Javascript function that I’ll call with an onClick when someone clicks the download button?? Or is there another way?

Thanks


03-23-2013 12:42 PM #2 kyuss (Member)

You can do this by putting the conversion pixel on your redirect for your dl. It isn't possible with php redirects though, the js redirect below works (save as .htm/.html):

Download Redirect:

Code:
<html>
<head>
<script type="text/javascript">
<!--
function delayer(){
    window.location = "http://www.js-redirect-to-your-download.com"
}
//-->
</script>
</head>

<body onLoad="setTimeout('delayer()', 5000)">
<h2>Prepare to be redirected!</h2>
<p>Downloading not-adware.exe in 5 seconds...</p>

<!-- CONVERSION PIXEL GOES HERE -->

</body>
</html>
Source: http://www.tizag.com/javascriptT/javascriptredirect.php

You can easily change the redirect speed and could empty the page so it is blank. If it redirects too fast your pixel might not fire every time though.

Problem is that the redirect will break for visitors with js disabled. To solve this use the code below for your download link on your landing page, it will give you two different versions of your link. One for visitors with js enabled and one for visitors with js disabled. Style the links however you like.

Send js disabled users directly to the download link or use a php redirect, they won't trigger the conversion pixel but at least they won't be completely lost.

LP Download Links JS Enabled/Disabled:
Code:
<!-- only users with javascript ENABLED will see this content -->
<script type="text/javascript">
document.write('<a href="http://js-enabled-redirect.com"><input type="button" value="JS ENABLED DOWNLOAD LINK"></a>');
</script>

<!-- only users with javascript DISABLED will see this content -->
<noscript>
<a href="http://js-disabled-redirect.com"><input type="button" value="JS DISABLED DOWNLOAD LINK"></a>
</noscript>
So it should be set up like:

js enabled visitor:
landing page -> js redirect with converion pixel -> direct download link

js disabled visitor:
landing page -> direct download link


Home > Tracking Campaigns > CPV Lab Pro