WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't want to have to make use of a destination url, so ideally I would like to be able to add the onclick="_gaq.push(['_trackPageview', '/G1/whatever']);" event to the submit button on the form.

share|improve this question
up vote 1 down vote accepted

This seems to be a valid answer:

Use Contact Form 7. In the "Additional Settings" box enter the following: on_sent_ok:"_gaq.push(['_trackPageview', '/G1/whatever']);"

Where /G1/whatever is the Goal URL you set on your Google Analytics options page.

share|improve this answer

You should be able to use Contact Form 7 and then attaching a jQuery click event to the submit button:

$(".wpcf7-submit").click(function() {
    _gaq.push(['_trackPageview', '/G1/whatever']);
});
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.