We're currently using Contact Form 7 for a user contact form on our site. We are tracking Goals (conversions) in Google Analytics as pageviews that are tracked when the contact form is submitted. This is working fine.
However, we'd like to attach the [your-name] field in our contact form to the user's session as a Custom Variable in Google Analytics. We're using the following code in the additional settings box to do this:
on_sent_ok: "_gaq.push(['_trackPageview', '/contact-us/august-sale']); _gaq.push(['_setCustomVar', 1, 'LeadName', '#your-name', 1]); window.location = 'http://www.example.com/thank-you/';"
This is sending the custom variable fine, however all conversions are coming through as simply "#your-name" rather than the actual name entered by the user. Is there a way we can use the form variable in this code?
Your help would be much appreciated.