javascript - 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:
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.
解决方案
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 加载的
推荐阅读
- php - 如何循环发送ajax请求
- php - 在 DK PDF 模板中显示 WooCommerce 产品图像
- r - data.table 选择键不等于值的行
- python - 将嵌套字典列表转换为 pandas DataFrame
- jquery - 如何在 HTML 折叠列表中分隔超链接?
- javascript - 如何在木材框架中设置环境变量?
- python-2.7 - 无法使用来自 PyCharm 的 Datastore 模拟器运行 dev_appserver.py
- html - 带有 Ion 幻灯片的 iOS 13 中 HTML5 音频控件消失了
- shopify - 变体 ID 与 Shopify 中其他信息之间的关系
- javascript - 计算属性中的变异数据也改变了 vuex 存储中的数据:为什么?任何帮助表示赞赏