如何为 ajax 表单提交设置 Google Analytics 目标 [英] How to set up Google Analytics Goal for ajax form submissions
问题描述
我有一个通过 ajax 提交的联系表单,成功提交后,会显示一条感谢/成功消息.
I have a contact form that is submitted via ajax and upon a successful submission, a thank you/success message is displayed.
此外,我在我的 Google Analytics(分析)帐户中设置了一个目标(目标完成网址)以访问感谢页面.
Additionally, I've set up a goal (Goal Completion URL) in my Google Analytics account for visits to a thank you page.
此页面不存在.
关于如何通过此方法设置跟踪成功表单提交的任何想法/建议?
Any thoughts/suggestions on how I can set up tracking successful form submissions via this method?
推荐答案
您可以使用虚拟浏览量.对于流程的每一步,添加对
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.
查看 GA 文档中的虚拟浏览量.
或者,如 Eduardo 建议的那样将其设置为事件目标,请参阅新的 Google Analytics:事件目标
Or, to set it up as an event goal as Eduardo suggested, see The New Google Analytics: Events Goals
这篇关于如何为 ajax 表单提交设置 Google Analytics 目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!