PPC Conversion Tracking using Javascript

Like this blog? Consider exploring one of our sponsored banner ads...

PPC Conversion tracking (Google/Yahoo/MSN) is straightforward for simple HTML websites. You place the conversion pixel on the thank you page. But when you have conversions in Flash sites or when the page is not reloaded after a conversion in the case of an ajaxed site, firing the conversion pixel is not as simple.

I created a simple javascript function that will include the tracking pixel as an iframe in the current page. All you have to do is change the url to the tracking pixel and then call the conversion function from your page or flash file.

function conversion() {
	var iframe = document.createElement('iframe');
	iframe.style.width = '0px';
	iframe.style.height = '0px'; 
	iframe.src = 'http://wwww.domain.com/pixel.html';

About this entry