Analytics.js: What does 'auto' argument do on tracking object creation?

前端 未结 2 1891
慢半拍i
慢半拍i 2021-02-07 04:38

I\'ve just switched to the new Google Analytics Universal Analytics platform, using the new javascript API - Analytics.js

In the first example code snippet from the doc

2条回答
  •  难免孤独
    2021-02-07 04:48

    Actually when I look in to code it does not pass the name of my property but the standard domain set in the configuration - which makes a lot more sense, since the parameter sets the cookie domain (in case of "auto" to the value of window.location.hostname to the hostname without subdomains). Alternatively you can pass a configuration object as third parameter (which might contain a cookie domain setting). Try and set a wrong parameter - you'll get a "no storage" error in the analytics debugger since the code cannot set a cookie.

提交回复
热议问题