按钮点击次数计为综合浏览量

时间:2013-07-17 14:52:36

标签: javascript google-analytics

我的客户有一个单页网站,并希望网站区域的主菜单上的每次点击都算作Google Analytics中的综合浏览量。这可能吗?我建议他使用活动。

1 个答案:

答案 0 :(得分:1)

是的,在JavaScript中调用_trackPageview。

_trackPageview()

_trackPageview(opt_pageURL)
Main logic for GATC (Google Analytic Tracker Code). If linker functionalities are enabled, it attempts to extract cookie values from the URL. Otherwise, it tries to extract cookie values from document.cookie. It also updates or creates cookies as necessary, then writes them back to the document object. Gathers all the appropriate metrics to send to the UCFE (Urchin Collector Front-end).

Async Snippet (recommended)

https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_gat.GA_Tracker_._trackPageview