英文:
Switch from Google Universal Analytics to GA4
问题
根据谷歌的建议,我们需要使用以下代码片段从UA迁移到GA4。
<!-- 谷歌标签(gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXX-Y"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXX-Y'); // Universal Analytics 属性。
gtag('config', 'TAG_ID'); // Google Analytics 4 属性。
</script>
我已经使用了这个脚本,到目前为止它运行正常。
我的问题是,如果在7月1日后UA过期了,上述(src)URL中仍然有UA-XXXXX标签,GA4是否仍然可以正常工作?
我希望我的GA4标签继续正常工作。
英文:
As per google we need to use this snippet to migrate to GA4 from UA.
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXX-Y"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXX-Y'); // Universal Analytics property.
gtag('config', 'TAG_ID'); // Google Analytics 4 property.
</script>
I have used this script and it works fine till now.
My question is, will having UA-XXXXX tag in above (src) url still keep GA4 working after 1st July when UA expires?
I want my GA4 Tag to continue to work.
答案1
得分: 1
在上述(src)URL中有UA-XXXXX
标签,将在2023年7月1日后UA到期后继续使GA4正常运作吗?
是的,它将继续运作,不会影响您的GA4。
2023年7月1日后,UA会继续收集数据吗?
- UA免费版将在2023年7月1日后停止处理数据。
- GA高级版(360)将在2024年7月1日后停止处理数据。
再详细一些
googletagmanager.com/gtag/js?id=UA-XXXXX-Y
中的id=UA-XXXXX-Y
部分是可选参数。
主要的gtag
js库是googletagmanager.com/gtag/js
,它是所有Google产品的全局库。
英文:
Will having the UA-XXXXX
tag in the above (src) url keep GA4 working after 1st July when UA expires?
Yes, It will work and will not impact your GA4.
Will UA collect the data after July 1st, 2023?
- UA free will stop processing the data after July 1, 2023
- GA Premium (360) will stop processing the data after July 1, 2024
Bit more detail on this
The id=UA-XXXXX-Y
part in googletagmanager.com/gtag/js?id=UA-XXXXX-Y
is an optional param.
The main gtag
js library is googletagmanager.com/gtag/js
and it is global for all Google Products.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论