Track adwords PPC ROI from a contact form using Google Analytics

Last modified on:

Following on from my last post, here is the analytics tracking code in the onclick handler that will pull the text entered into the contact form and submit it to google analytics event tracking. This will label each action with the users email address (although you could use any part of the form as a unique identifier). The benefit of this is if you select the paid search segment, and can link these email addresses (or other information entered on the contact form) to converted sales from your sales information then you will know what kind of return you are getting on your pay per click spend, such as adwords.

Use this code on the form button:

onClick="pageTracker._trackEvent('Form', 'Submit Contact', document.Form1.txtEmail.value);

You need to replace ‘Form1’ with the name you have given your form, and then change ‘txtEmail’ for the name of the particular part of the form you want to pull the value from.

*Apparently linking GA data to individual visitor info is in breach of GA’s terms and conditions – something about it being an invasion of privacy – so use at your own risk! I don’t see how this applies in this case, as it only affects visitors that contact you with their information, which they are sending to you anyway… so hardly an invasion of privacy? Still, you’ve been warned!


Published on

in

by

One response to “Track adwords PPC ROI from a contact form using Google Analytics”

  1. […] « Obama – a new age for American foreign policy? Track adwords PPC ROI from a contact form using Google Analytics […]

Leave a Reply

Your email address will not be published. Required fields are marked *