How to set up Google Analytics Goal for ajax form submissions

前端 未结 3 529
难免孤独
难免孤独 2021-02-02 09:40

I have a contact form that is submitted via ajax and upon a successful submission, a thank you/success message is displayed.

Additionally, I\'ve set up a goal (Goal Comp

3条回答
  •  情深已故
    2021-02-02 10:04

    You can use virtual pageviews. For each step of the process, add a call to

    _gaq.push(['_trackPageview', '/ajax-contactForm/PAGE-or-STEP-NAME.html']);
    

    This will register as a pageview and can be used as a step in the goal.

    See virtual pageviews in the GA docs.

    Or, to set it up as an event goal as Eduardo suggested, see The New Google Analytics: Events Goals

提交回复
热议问题