Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/466.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 Autotrack.js插件urlChangeTracker不适用于单页应用程序_Javascript_R_Google Analytics_Shiny - Fatal编程技术网

Javascript Autotrack.js插件urlChangeTracker不适用于单页应用程序

Javascript Autotrack.js插件urlChangeTracker不适用于单页应用程序,javascript,r,google-analytics,shiny,Javascript,R,Google Analytics,Shiny,我正在尝试使用urlChangeTracker来跟踪托管在云中linux虚拟机上的R应用程序的使用情况。shiny应用程序基本上是一个单页应用程序,其形式为包含多个选项卡的仪表板。我以这样的方式构建了闪亮的应用程序:对于每个标签,网站的url都会改变,因此(理论上)我可以使用urlChangeTracker插件跟踪用户正在查看的标签 我的跟踪代码段如下所示: <script> window.ga=window.ga||function(){(ga.q=ga.q||[]).push(a

我正在尝试使用urlChangeTracker来跟踪托管在云中linux虚拟机上的R应用程序的使用情况。shiny应用程序基本上是一个单页应用程序,其形式为包含多个选项卡的仪表板。我以这样的方式构建了闪亮的应用程序:对于每个标签,网站的url都会改变,因此(理论上)我可以使用urlChangeTracker插件跟踪用户正在查看的标签

我的跟踪代码段如下所示:

<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-XXXXX-Y', 'auto');

ga('require', 'urlChangeTracker')

ga('send', 'pageview');
</script>
<script async src="https://www.google-analytics.com/analytics_debug.js"></script>
<script async src="path/to/autotrack.js"></script>

window.ga=window.ga | |函数(){(ga.q=ga.q | |[]).push(参数)};ga.l=+新日期;
ga(“创建”、“UA-XXXXX-Y”、“自动”);
ga('require','urlChangeTracker')
ga(‘发送’、‘页面浏览’);
我没有使用npm安装autotrack.js,但我已从autotrack github存储库下载了该文件,并将其保存在linux服务器上的可访问目录中。我还通过访问myWebsite.com/autotrack.js检查了autotrack.js文件是否可用,该文件的可用性如下:

(function(){var g,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},k="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function l(){l=function(){};k.Symbol||(k.Symbol=ba)}var ca=0;function ba(a){return"jscomp_symbol_"+(a||"")+ca++}
function m(){l();var a=k.Symbol.iterator;a||(a=k.Symbol.iterator=k.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return da(this)}});m=function(){}}function da(a){var b=0;return ea(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function ea(a){m();a={next:a};a[k.S 
[...]
(function(){var g,aa=“function”==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get | | | c.set)抛出新的TypeError(“ES3不支持getter和setter”);a!=Array.prototype&&a!=Object.prototype&(a[b]=c.value)},k=“undefined”!=typeof window&&window==这是:“undefined”!=typeof global&&null!=global?global:this;函数l(){l=function(){};k.Symbol | | | |(k.Symbol=ba)}var ca=0;函数ba(a){返回“jscomp|u Symbol |”+(a | |“”)+ca++

函数m(){l();var a=k.Symbol.iterator;a | |(a=k.Symbol.iterator=k.Symbol(“iterator”);“function”!=typeof Array.prototype[a]&&aa(Array.prototype,a,{可配置:!0,可写:!0,value:function(){return da(this)});m=function(){function(){da(a){var b=0;return ea function(){return b找到解决方案。与我用shiny更新url的方式有关。@zins博士,你能解释一下问题是什么以及你是如何解决的吗?我也有类似的问题?找到了解决方案。与我用shiny更新url的方式有关。@zins博士,你能解释一下问题是什么以及你是如何解决的吗?我也有类似的pr问题?
Initializing Google Analytics.
analytics_debug.js:16 No plugin url set for "urlChangeTracker".
analytics_debug.js:16 Registered new plugin: ga(provide, "cleanUrlTracker", Function)
analytics_debug.js:16 Registered new plugin: ga(provide, "eventTracker", Function)
analytics_debug.js:16 Registered new plugin: ga(provide, "impressionTracker", Function)
analytics_debug.js:16 Registered new plugin: ga(provide, "maxScrollTracker", Function)
analytics_debug.js:16 Registered new plugin: ga(provide, "mediaQueryTracker", Function)
analytics_debug.js:16 Registered new plugin: ga(provide, "outboundFormTracker", Function)
analytics_debug.js:16 Registered new plugin: ga(provide, "outboundLinkTracker", Function)
analytics_debug.js:16 Registered new plugin: ga(provide, "pageVisibilityTracker", Function)
analytics_debug.js:16 Registered new plugin: ga(provide, "socialWidgetTracker", Function)
analytics_debug.js:16 Registered new plugin: ga(provide, "urlChangeTracker", Function)
analytics_debug.js:16 Running command: ga("create", "UA-XXXXX-Y", "auto")
analytics_debug.js:16 Creating new tracker: t0
analytics_debug.js:16 Auto cookieDomain found: "example.com"
analytics_debug.js:16 Running command: ga("require", "urlChangeTracker")
analytics_debug.js:16 Plugin "urlChangeTracker" intialized on tracker "t0".
analytics_debug.js:16 Running command: ga("send", "pageview")
analytics_debug.js:16 Setting throttling cookie: "_gat"
analytics_debug.js:16 
Sent beacon:
v=1&_v=j79d&a=1855665599&t=pageview&_s=1&dl=https%3A%2F%2Fexample.com%2Ftab1%2tab2%2F&ul=nl-nl&de=UTF-8&dt=example%20tab3%20tab4&sd=24-bit&sr=1920x1080&vp=1140x901&je=0&_u=QCCAAEAD~&jid=2127417377&gjid=1964178890&cid=428550628.1567514178&tid=UA-55220421-10&_gid=1087991776.1567514178&_r=1&_av=2.4.1&_au=100&did=i5iSjo&z=198028291


analytics_debug.js:16 <unknown>        (&did)  i5iSjo
analytics_debug.js:16 _j1              (&jid)  2127417377
analytics_debug.js:16 _j2              (&gjid) 1964178890
analytics_debug.js:16 adSenseId        (&a)    1855665599
analytics_debug.js:16 apiVersion       (&v)    1
analytics_debug.js:16 clientId         (&cid)  428550628.1567514178
analytics_debug.js:16 encoding         (&de)   UTF-8
analytics_debug.js:16 hitType          (&t)    pageview
analytics_debug.js:16 javaEnabled      (&je)   0
analytics_debug.js:16 language         (&ul)   nl-nl
analytics_debug.js:16 location         (&dl)   https://example.com/
analytics_debug.js:16 screenColors     (&sd)   24-bit
analytics_debug.js:16 screenResolution (&sr)   1920x1080
analytics_debug.js:16 title            (&dt)   example
analytics_debug.js:16 trackingId       (&tid)  UA-XXXXX-Y
analytics_debug.js:16 viewportSize     (&vp)   1140x901
analytics_debug.js:16 Registered new plugin: ga(provide, "render", Function)
(index):544 Uncaught TypeError: $(...).accordion is not a function
    at HTMLDocument.<anonymous> ((index):544)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at Function.ready (jquery.min.js:2)
    at HTMLDocument.K (jquery.min.js:2)
(anonymous) @ (index):544
[...]