Search code examples
google-analyticse-commerceweb-analyticsevent-tracking

How to track conversions without a confirmation page


I have a form on my site that, upon a successful completion, triggers a confirmation message in a modal. I need to be able to track the conversions on this form. I think I need an event tracker here, but I can't figure out where I'd put it.

The form is at http://www.nearlynewlywed.com/a/sell


Solution

  • The best practice is to create a virtual page view that will simulate a "thank you" page that will trigger the goal.

    Execute this JS code when the form is validated and submitted:

    _gaq.push(['_trackPageview', '/your-directory/form/thank-you']);
    

    If you use Universal Analytics, then:

    ga('send', 'pageview', '/your-directory/form/thank-you');
    

    Now the thank you page will be rendered as a pageview, which will appears on your reports and Goals' funnel visualization. Remember to set the "/your-directory/form/thank-you" as the goal destination on Google Analytics.