Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

If a contact form's URL stays the same after submitting the form, how can I track goal conversions in Google Analytics for filling in the form?

Normally I would add the confirmation page's URL into the Goal in Google Analytics, but on this particular site when submitting the form, the content dynamically changes to say "thank you", rather than a new URL loading.

share|improve this question

3 Answers 3

The simplest way to do this is to fire an event when the form is submitted. Then in analytics configure a goal based on the triggering of the event. (Event based goals is just another type of goal.)

share|improve this answer

There are two ways to do this -

  1. Using Events in Google Analytics, and then configuring the Goal on that Event being fired.
  2. In the form URL, add a specific URL parameter which you are sure does not do anything (yes, you read that right). Typical flow would be ... user lands on landing page, submits form, ends up on the same page (except with an additional parameter). In GA configure a funnel with the page without the parameter as the starting page, and the page with the parameter as the conversion page.
share|improve this answer

You need to fire an event (or a fake pageview using trackPageview) after the form has been validated, ie when the content dynamically changes.

Do not add this code on submitting the form alone, as that will count any clicks that fail your validation.

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.