简体   繁体   English

Google Analytics设置(高级Javascript)

[英]Google Analytics setup (advanced Javascript)

I have three buttons on my website, all of the buttons opens a pop up contact form. 我的网站上有三个按钮,所有按钮都会弹出一个弹出的联系表单。

The three buttons are for different things eg: 这三个按钮用于不同的事情,例如:

Request a call Get a brochure Visit us 请求电话获取宣传册访问我们

But they all open the same form; 但他们都打开了同样的形式; What I want to do is use Google analytics to track the form and know what button they originally clicked; 我想要做的是使用Google分析来跟踪表单并知道他们最初点击的按钮; is this possible? 这可能吗?

Can an onClick function be used on the button or something? 可以在按钮上使用onClick功能吗?

Really need some help on this! 真的需要一些帮助!

Event tracking would be a better option since it won't over-inflate your pageviews. 事件跟踪是一个更好的选择,因为它不会过度夸大您的综合浏览量。 You can also set events as goals now . 您现在还可以将事件设置为目标

<a href="#" onClick="_gaq.push(['_trackEvent', 'Contact Form', 'Button Click', 'Request a call']);">Request a call</a>

See the Event Tracking Guide 请参阅“ 事件跟踪指南”

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM