Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How to add Google AdWords Conversion Tracking Code in JS Form WordPress

  • REFUNDED

Ok, my issue is inserting the Google AdWords Conversion Tracking Code into my site so that I can track my conversions from my contact form. The issue is that my contact form is a javascript one and me being a designer not a developer, I am left to just %$#& it up. I know it's really easy, but just can't figure it out. If anyone can help or better yet do it, it would be worth $40 bucks...


I will supply the conversion code as well as the server info/ wpadmin info to drop in the code...

Answers (3)

2011-05-17

Caroline Keim answers:

Hi, I could help you out.

Can you post your contact form and the tracking code you're trying to insert? Feel free to leave out your specific user ID in the tracking code. I just want to show you where to place this code.

Thanks!


Caroline Keim comments:

You need to edit your contact button seen here -

<input id="submit" class="submit" type="submit" value="Submit" name="">

So add this above the contact us button -

<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
<script type="text/javascript">
function trackConv() {
var google_conversion_id = XXXXX;
var othergooglevariables = gohere;
image.src = "http://www.googleadservices.com/pagead/
conversion/"+google_conversion_id+"/?label="+google_conversion_label
+"&script=0"; }

</script>

<input id="submit" class="submit" type="submit" value="Submit" name="" onclick="javascript:trackConv();">

2011-05-18

Ehthisham tk answers:

hey are u using jquery ajax form? if so use this
$.ajax({
async: true,
type: "POST",
dataType: "json",
url: <Your URL>,
data: _data,
success: function( json ) {

// Track conversion
var google_conversion_id = <Your ID Here>;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "<Your Label here>";
var google_conversion_value = 0;
if (100) {
google_conversion_value = <Your value here if any>;
}
$.getScript( "http://www.googleadservices.com/pagead/conversion.js" );

} // success
});


ericnunlee comments:

Can you insert the code? I am a novice as I stated...

2011-05-20

Richard M. answers:

Hello,

I'm happy to help, and yes I can install the code: http://wp-themes-and-plugins.com/ for live chat