Google Adwords conversion Tracking event - single page Google Adwords conversion Tracking event - single page wordpress wordpress

Google Adwords conversion Tracking event - single page


The encoded URL will be fine. Note that the label and goalID values will need to be the correct values from AdWords - label is now optional though so if one isn't provided in AdWords you'll need to remove it from this script (dont just pass garbage as that may lead to bad tracking)

However, this said if I were you rather than re-inventing the wheel and rolling my own code, I would just use the official Google tag that was designed specifically for this sort of usage:

https://developers.google.com/adwords-remarketing-tag/asynchronous/

That page explains what you need to do - it is coming from a remarketing perspective, but the conversion tag and the remarketing tag are basically the same thing (that is what the "google_remarketing_only" true/false is about - you'll want it to be "false" as this is conversion tracking).

So you'll want something like this, then just call google_trackConversion() whenever the form gets submitted - no messing about with encoding etc this way:

<!-- Put this script in your <head> --><script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion_async.js" charset="utf-8"></script><!-- the rest of your web page as usual etc --><!-- Call this function when the form submits --><script type="text/javascript">/* <![CDATA[ */window.google_trackConversion({  google_conversion_id: 123456789,   google_conversion_label: abcdefghijkl,  // if provided, remove this line if not provided  google_conversion_value: 0,  // or the dollar value of this conversion, e.g. 100 etc.  google_remarketing_only: false});//]]>

Hope that helps.