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.


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.)


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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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