Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 按钮点击数计入页面浏览量_Javascript_Google Analytics - Fatal编程技术网

Javascript 按钮点击数计入页面浏览量

Javascript 按钮点击数计入页面浏览量,javascript,google-analytics,Javascript,Google Analytics,我的客户有一个单页网站,希望在谷歌分析中,每次点击主菜单上的站点区域都算作页面视图。这可能吗?我建议他使用事件。是的,用JavaScript调用trackPageview _trackPageview() _trackPageview(opt_pageURL) Main logic for GATC (Google Analytic Tracker Code). If linker functionalities are enabled, it attempts to extract cook

我的客户有一个单页网站,希望在谷歌分析中,每次点击主菜单上的站点区域都算作页面视图。这可能吗?我建议他使用事件。

是的,用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)

否,您可以调用此函数来记录自己的操作。它通常用于基于AJAX的单页应用程序。