JavaScript onClick Google AdWords Conversion Tracking

Original posted on Erik Vold’s Blog

This is really just a technique to convert the provided Google AdWords Conversion Tracking Code into something more a little more useful.

Take the conversion code provided, usually something like:





]]>

And convert it into this:


var uniqueConversionFunctionName = function(){
var image = new Image(1,1);
image.src = “https://www.googleadservices.com/pagead/conversion/1234567890/?value=1&label=Purchase&script=0”;
return;
}

]]>

Notice that in the second block of code above, I’ve taken the source of the image which was provided by Google in the first block of code’s noscript tag.

That’s it! with this your Google AdWords conversion no longer has to be a landing page, it can be a button click event, or whatever else you want it to be.

Author

cp_admin

Share
Published by
cp_admin

Recent Posts

We are heading to RampUp 2026

Our team is heading to San Francisco March 3-5 for RampUp 2026. We'll be meeting…

2 weeks ago

OOPS! The Consumer Signal You Might Be Overlooking in Your Privacy Strategy

The rise of browser-based Opt-Out Preference Signals (yes, OOPS) is quietly reshaping online consent experiences.…

3 weeks ago

Merkle Americas Becomes Amplitude’s First North American Reseller

We’re thrilled to announce that Merkle Americas has officially agreed to become the platform’s first-ever…

1 month ago

This website uses cookies.