How to Get Google AdWords Conversion Tracking on WordPress
Getting the dreaded “Verification Failed” message when trying to add AdWords conversion tracking to your WordPress blog?

Look no further! Here’s a simple fix (a little bit of a hack) that will get you tracking Google AdWords conversions on your WordPress pages in no time flat.
Step 1 - Install Website Optimizer Plugin
Download, install, and activate the Google Website Optimizer Plugin for Wordpress. This plugin is intended for use with Google’s Website Optimizer, but in this case we’re going to use it for tracking AdWords conversions instead.
Google AdWords Tracking Professionally Installed On Your WordPress Site For Just $49
If you need help installing the tracking code we can do it for you. Enter your email address and website URL in the fields below, click Buy Now to pay securely with PayPal, and we’ll contact you within one business day to arrange installation.
Step 2 - Grab (Copy) Your AdWords Conversion Tracking Code
In your AdWords account, grab the code snippet for the conversion action you want to track and copy it to your clipboard. The conversion tracking code looks something like:
<!-- Google Code for Web Design Mistakes Signup Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = XXXXXXXXXX;
var google_conversion_language = "en_US";
var google_conversion_format = "1";
var google_conversion_color = "ffffff";
var google_conversion_label = "lqn9CIa8VRDXhf7-Aw";
//-->
</script>
<script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height="1" width="1" border="0" src="http://www.googleadservices.com/pagead/conversion/XXXXXXXXXX/
?label=lqn9CIa8VRDXhf7-Aw&script=0"/>
</noscript>
Step 3 - Add The Tracking Code As A Custom Field
Update: BEFORE you add and save the tracking code, note the following important caveat pulled from the website optimizer plugin readme.txt:
- Make sure the WYSIWYG editor is disabled in the WordPress administration area under “My Account” - uncheck “Use the visual editor when writing”. Switching between the “Visual” and “code” tabs in the 2.1.x WYSIWYG editor won’t work - it needs to be disabled.
In the WordPress admin, navigate to the page you want to add conversion tracking to, and scroll down to the Custom Fields section under Advanced Options:

1) In the Key field, enter the website optimizer key for tracking conversions: go_tracking_script_conversion
2) In the Value field, paste your AdWords conversion tracking code in its entirety.
3) Click Add Custom Field and then Save / Publish your post. Make sure your post is not set to “private” otherwise the Google verification checker will not be able to see and therefore verify that tracking is installed correctly.
Step 4 - Verify Action Code
Go back to your Google AdWords account and verify that the action code is installed correctly. If you followed the steps above, everything should be installed correctly and you should see the success message!

There you have it -now you have an easy way to track AdWords conversions on your WordPress blog.
A few caveats to keep in mind:
- This plugin is designed to be used with Website Optimizer - not AdWords Conversion Testing. I have not tested whether it can be used simultaneously to track both.
- Tested on WordPress 2.5. Your mileage may vary, although I think this method should work on any version supported by the Website Optimizer plugin.
- As noted in step 3, be sure to disable the WYSIWYG editor before adding the tracking code.
P.S. How are you tracking conversions on your WordPress blog? Share some of your favorite plugins and methods in the comments below.
Update Nov 3, 2009:
If you prefer to code the tracking directly into your WordPress templates, here is an excellent tutorial for doing just that:
http://www.internetmegaphone.com/how-to-use-google-conversion-tracking-in-wordpress/
« Compete vs. Alexa and the Dangers of Toolbar Metrics | Home | Web Design SEO Tips - Build a Search Engine Ranking You Can Be Proud Of »







All comments are do-follow and individually moderated. We respect and encourage genuine interaction that adds value to the conversation.
Comments
I’m not able to save a new Key, for some reason. Every time I paste go_tracking_script_conversion, then my Adwords conversion code, and click “Add Custom Field” the screen refreshes and the Key hasn’t been saved.
Any ideas how to fix that?
Moe, what version of WordPress are you using?
Here’s the supported version info (including a patch requirement) from the contentrobot.com website:
The current version (v0.2) works with WordPress 2.x* and above (Including 2.5)
*Important Note: If you are running WordPress versions 2.0.x, you must patch /wp-includes/functions-formatting.php to fix this WordPress bug. If you do not apply the patch, any parenthesis characters will be converted to the html equivalent (#8221;) and will cause the Google Website Optimizer section scripts to fail. This bug has been fixed in WordPress 2.1.x
This is not working. I’ve followed the instructions and it is entered into the code on the following page:
http://www.paddlesurfholidays.com/contact-us/contact-success
It still gives a verification error.
David, I had a look at the source of your page and noticed
<br/>tags after the lines of your Google conversion code - a sure sign that WordPress didn’t save it properly.After going back to the website optimizer plugin readme, I noticed I had left out an important step that may be causing your problem. I’ve updated Step 3 in the post - I suspect your problem is being caused by not having the WYSIWYG disabled when you add your tracking code:
Make sure the WYSIWYG editor is disabled in the WordPress administration area under “My Account” - uncheck “Use the visual editor when writing”. Switching between the “Visual” and “code” tabs in the 2.1.x WYSIWYG editor won’t work - it needs to be disabled.
Try disabling it, running through the steps again and let me know how it goes.
Hi John–
I have the same problem as with the paddle surf holiday website.
I’ve done everything you said, including turning off the visual editor and the Adwords Conversion Tracking is still giving me an error of “verification failed”.
I know from the last time this plugin does not work with WP Shopping Cart, therefore it had to be disabled. I’m thinking this plugin is friendly with the other plugins we are using.
What are your thoughts?
http://www.customstickersdirect.com/order/order-success
Hi David - for some reason both of your success pages are still showing the linebreaks - I really think that is the source of your problem but I’m not sure why they’re there if you have in fact turned off (and I mean completely disabled for the user) the visual editor.
If you look at the source of this page - http://www.ozonesem.com/web-design-seo-mistakes/subscription-confirmed - you’ll see there are no
<br/>tags in the code block for the conversion code. Conversion tracking works for that page.It’s almost certainly a problem with the visual editor…
Hi again - still frustrated.
I followed all the instructions (including turning off visual editor) without success.
I looked at the source code of my page, and it’s showing a tag after the Google converson script. I have no idea how to remove this, though. The is before my footer PHP file.
I figured it out. You have to create a separate WP page template for your thank-you page, and insert the conversion code in that page.
Thanks for the post. I had some trouble at first, but then I discovered this: After I saved the custom field, it automatically replaced every ” with \”. I got around it by, re-pasting the code in the “value” box and clicking “Update”. This will not replace all of the quote marks, so when I saved the post, it looks right.
Has anyone noticed that this method stopped working with version 1.2 of the plugin?
Hi, does this work with more than one AdWords account to track?
I have installed the code an Opt-In ThankYou page to track subscribers from an AdWords campaign. Now I want to track another campaign from a completely different AdWords account.
I have another action code to add, but I notice that the Custom Field name is the same ie “go_tracking_script_conversion” even though the Action Code is different (for the second AdWords accounts).
So could I still add the second (and third and so on) Action Code, or would it not work because the Custom Field name is the same?
THANKS for this guide!
Clever idea. Always challenging to insert tracking code in WP, but this worked like a charm!
Good thinking for developing this solution. However, I just pasted my conversion tracking code into the code part of the WYSIWYG editor and am quite surprised it works perfectly! I guess I was lucky. I’ll be back if it doesn’t work on another blog. Keep up the good work.
Hi there, when looking for a solution to this problem, I found this post. Thanks a lot for your solution.
In the end though, I made a small plugin that lets you add code to the end of each single post/page content. If you’re interested, you can find it here:
http://www.creativeclans.nl/products/embed-script/
The good thing is you won’t have to hack anything anymore
Hi there. This is an old post, but very interesting. But I can see in this plugins that you have an option to add the conversion code under the editor space, but…
What happen if you need to insert two or more conversion code? In my case I use Adwords and Yahoo.
Thanks
Valentin
I wrote a solution to this: Wordpress Conversion Tracking
The solution itself is pretty simple. If you have an onsite checkout process it’s not difficult to enable your Adwords Conversion tracking.
The basics of the article explains:
1. Put conversion code in separate php file
2. Put this in your footer
3. Add php code to insert code only when users complete conversion
This solution only works for on-site checkout and won’t solve your problem for Google Checkout, Paypal, etc.
Guido, thanks for your comment. I haven’t tried your plugin but that looks like a clean and generic solution.
I’m using the Thesis theme which appears to have this plugin, or something quite similar, built into it.
I followed these steps, and presto—works like a champ.
Leave a Comment