首页 > 解决方案 > analytics.js URL Calls

问题描述

I use analytics.js on a html page behind a hotspot. So the internet connection is limited to certain URLS.

I need to open on walled garden all the URLS used by analytics.js to make work correctly google analytics.

I did add:

ssl.google-analytics.com
*google-analytics*
*doubleclick*

But still need more URLs.

I've tested that adding

www.google.es and www.google.com analytics works ok and no errors appears on the urls called by analytics.js but I can NOT open www.google.es and www.google.com for other devices uncompatibility so I need to know the URLs need to be opened to have analytics working ok.

I found reading analytics.js that there is:

https://ampcid.google.com
https://www.google.%/ads/ga-audiences
google.com(:\d+)?\/optimize\/opt-launch\

I did add this URLs + Folders on walled garden but still not enought.

Can anyone help me on build all the URLS+Folder list used by analytics ?

Thanks a lot.

Added Image I can see on Network from a browser:

enter image description here

Added 2: I have this script:

 <script>
   (function(i,s,o,g,r,a,m) 
{i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
   (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
   m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
   })(window,document,'script','https://www.google- 
analytics.com/analytics.js','ga');

   ga('create', 'UA-48205710-1', 'socialwibox.com');
   //ga('send', 'pageview');

 </script>

And have problems just when calling ga('send', 'pageview'); without ga('send', 'pageview'); i don't have problems.

Oscar.

标签: javascriptgoogle-analyticsroutinggoogle-analytics-api

解决方案


Google Analytics 收集数据的基本端点是 POST/GET /collect HTTP/1.1 主机:www.google-analytics.com

此外,人口统计数据可能会转到 http[s]://stats.g.doubleclick.net/r/collect

analytics.js 脚本从 http[s]://www.google-analytics.com/analytics.js 加载

如果使用 gtag.js 或 google 标签管理器,它们是从 http[s]://www.googletagmanager.com/gtag/js?id=XXXX 加载的


推荐阅读