如何为ajax表单提交设置Google Analytics目标 [英] How to setup Google Analytics Goal for ajax form submissions

查看:104
本文介绍了如何为ajax表单提交设置Google Analytics目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通过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 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆