简体   繁体   English

如何在Google Analytics(分析)中跟踪表单提交为页面视图?

[英]How to track form submit as page view in Google Analytics?

I have a basic AJAX form. 我有一个基本的AJAX表单。 On successful submission, I'd like to set the success message as a page view in GA. 成功提交后,我想将成功消息设置为GA中的页面视图。

I'm trying this: 我正在尝试:

window.ga('send', 'pageview', 'My Form', 'submit')

I've heard I need to use Google Tag Manager, but I'd rather simply use the existing GA if I can already in place. 我听说我需要使用Google跟踪代码管理器,但如果可以的话,我宁愿使用现有的Google Analytics(分析)。

Advice on the best and most simple approach for this would be great. 关于最好和最简单的方法的建议会很棒。 Thanks. 谢谢。

The pageview tracking format through the ga object is: 通过ga对象的综合浏览量跟踪格式为:

ga('send', 'pageview', [page], [fieldsObject]);

where page value should begin with a / . page值应以/开头。 Reference here . 参考这里

In your case it would be something like: 在您的情况下,它将类似于:

ga('send', 'pageview', '/form-submitted', [fieldsObject]);

The other option would be to track virtual pageviews . 另一个选择是跟踪虚拟网页浏览量 The syntax for tracking virtual pageviews is: 跟踪虚拟网页浏览量的语法为:

ga('set', 'page', '/form-submitted');
ga('send', 'pageview');

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Google Analytics(分析)中跟踪网站搜索,而不将其计为网页浏览量? - How to track site search in Google Analytics and not count as a page view? 如何使用Google Analytics(分析)跟踪“提交”按钮? - How to track the “Submit” button using Google Analytics? 点击表单提交后,在Google Analytics中跟踪事件 - Track event in google analytics upon clicking form submit Google Analytics(分析)-如何在用户提交表单时跟踪他们的登录ID - Google Analytics - How to track logged in user's ID when they submit a form 如何使用Google Analytics(分析)跟踪表单提交 - How to track a form submission using Google Analytics 如何使用PHP在重定向页面上使用Google Analytics跟踪? - How to track with Google Analytics on a redirection page with PHP? Google Analytics(分析)-页面退出时的跟踪事件(表单提交除外) - Google Analytics - Track Event on Page Exit (Except form submission) 如何在网络单页应用程序中使用 Firebase Analytics 跟踪页面浏览量? - How to track page view with Firebase Analytics in a web, single page app? 如何根据提交的表单在Google Analytics(分析)中跟踪转化? - How do I track a conversion in Google Analytics Based on Form Submission? 如何使用jQuery或JavaScript准确跟踪Google Analytics(分析)中的表单放弃 - How to accurately track Form Abandonment in Google Analytics using jQuery or JavaScript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM