从Google通用分析切换到GA4

huangapple go评论48阅读模式
英文:

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.

&lt;script async src=&quot;https://www.googletagmanager.com/gtag/js?id=UA-XXXXX-Y&quot;&gt;&lt;/script&gt;
&lt;script&gt;
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag(&#39;js&#39;, new Date());

  gtag(&#39;config&#39;, &#39;UA-XXXXX-Y&#39;);         // Universal Analytics property.
  gtag(&#39;config&#39;, &#39;TAG_ID&#39;);  // Google Analytics 4 property.
&lt;/script&gt;

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.

huangapple
  • 本文由 发表于 2023年6月22日 15:05:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76529343.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定