Google Analytics 4实战指南——(2025)

⌘K
  1. 主页
  2. 文档
  3. Google Analytics 4实战指南——(...
  4. 第1章 Google Analytics 4基础知...
  5. 1.3、 Google Analytics 4的发展史

1.3、 Google Analytics 4的发展史

文章目录[隐藏]

更新时间:2025年1月5号

GA1:Urchin Analytics Code (urchin.js)

2005年4月,Google在2005年的时候收购了Urchin,Urchin更名为“Urchin from Google”:

Urchin

Urchin from Google

2005年11月,谷歌基于Urchin发布了第一版的Google Analytics,这一版加载的js仍然是使用urchin.js,这时期的跟踪代码是这样的:

<!— Sample Urchin Analytics Code -><script src="”https://www.google-analytics.com/urchin.js”" type="”text/javascript”"></script><script type="”text/javascript”">
_uacct = “UA-XXXXXXX-X”;
_userv = 2; urchinTracker();
</script><— Sample Urchin Analytics –>

虽然免费版的Google Analytics有一定的限额,能满足绝大部分的需求,所以深受市场欢迎,一周内就注册了超过10万用户,导致对服务器的压力很大,数据量是谷歌预期的四倍,使得谷歌不得不暂停了Google Analytics的注册,改为邀请注册制。

2006年8月,停止邀请注册制,向所有的用户开发注册。

GA2:Google Analytics Classic(ga.js)

Google Analytics Synchronous Code(同步加载)

在2007年4月,谷歌发布了同步加载代码,同步加载代码是用ga.js和PageTracker跟踪器,这一时期的跟踪代码是这样:

<—Sample GA Synchronous Code –><script type="”text/javascript”"> 
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “https://www.”);
document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script><script type="”text/javascript”">
try
var pageTracker = _gat._getTracker(“UA-xxxxxx-x”);
pageTracker._trackPageview();
} catch(err) {}
</script>
  • 2007年5月,发布新版的Reporting Interface
  • 2008年10月,增加Custom Reports 和 Advanced Segments
  • 2009年4月,增加APIs
  • 2009年6月,增加Event Tracking
  • 2009年11月, 增加Custom Alerts

Google Analytics Asynchronous Code(异步加载)

2009年12月,谷歌发布异步加载代码,用于取代同步加载对页面的限制,这个版本主要的两个不同点在于_gaq.push 和ga.js,这本版本个的跟踪代码如下:

<script type="text/javascript"> 
var _gaq = _gaq || [];
_gaq.push([‘_setAccount’, ‘UA-XXXXXXXX-X’]);
_gaq.push([‘_trackPageview’]); (function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘https://www’) +
‘.google-analytics.com/ga.js’; var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);})();
</script>
  • 2011年8月,增加MCF
  • 2011年9月,增加Google Analytics Premium Real-Time 
  • 2011年10月,增加Flow visualisations
  • 2012年7月,增加Content Experiment 和 GA for mobile applications. 
  • 2012年9月,增加Display Advertising CodeEnhanced Link Attribution
  • 2012年10月,增加Data Import 和 Google Tag Manager(GTM)

GA3:Google Analytics Universal(analytics.js)

2012年10月,谷歌发布了 Universal Analytics,它用的是 ‘analytics.js’,这个版本增加了跨站跟踪, Custom DimensionsCustom Metrics,这一时期的跟踪代码是这样:

<!-- Google Analytics -->
<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-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
  • 2013年3月,增加Measurement Protocol 
  • 2013年6月,增加Attribution Models
  • 2013年9月,谷歌的搜索由于http升级到加密的https,Google Analytics中不再获得自然搜索关键字,变成了“(not provided)” 。

Ecommerce Code(ecommerce.js)普通电商

Enhanced Ecommerce Code(ec.js)增强电商

  • 2014年5月,增加Enhanced Ecommerce
  • 2016年3月,谷歌发布Google Analytics 360, 给企业提供一站式的数字营销解决方案,Google Analytics 360包含Analytics, Tag Manager, Optimize, Data Studio, Surveys, Attribution和 Audience Center.
  • 2016年9月,谷歌发布Google Analytics Solutions,包含Google Analytics, Google Tag Manager, Google Optimize, Google Data Studio, Google Survey, Google Attribution, 和 Google Audience Center.

GA4:Google Analytics 4 (gtag.js)

由于GA在数据传输和用户隐私方面在欧盟受到很大的监管压力,有被禁用的可能,急需一个新版本的GA去满足欧盟的法律法规要求。

但期间苹果发布的一些ITP规则对现有的数据跟踪和广告归因巨大的影响,Google不得不推出一个临时过渡版,所以才造成GA4版本有些混乱。

有些划分会将这个过渡版本划分到GA3里,我是将其划分到GA4,主要是考虑其加载js已经是gtag.js

过渡(普通全局版)

在2017年,谷歌发布Global Site Tag,这个让Adwords, DoubleClick, 和Google Analytics都用同一套写法,这一时期的跟踪代码如下:

<!-- Global site tag (gtag.js) - Google Analytics --><script src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXX-X" async=""></script><script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-69988360-20');
</script>
  • 2018年6月,谷歌发布Google Marketing Platform,它包含谷歌的两大产品:DoubleClick Digital Marketing 和Google Analytics 360,延伸阅读:Google Marketing Platform:统一的广告和分析平台
  • 2018年8月,谷歌发布Google Signals 
  • 2019年8月,谷歌发布 APP+Web Property用于取代Google Analytics For APP,将APP和Web的数据汇总到同一个媒体资源,一起跟踪,这个版本的报告页面做了很大的升级,跟踪代码也不一样:
<!-- Global site tag (gtag.js) - Google Analytics --><script src="https://www.googletagmanager.com/gtag/js?id=G-XJGBFSLMD8" async=""></script><script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-XJGBFSLMD8');
</script>

需要注意,这里的跟踪代码用的是测量ID,结构是G-***,这是混合版的跟踪代码特征。

到此,全局版可以分为两个版本:

  • 一个是普通全局版,里面用的是tracking Id,tracking Id的结构是UA-*******
  • 一个是混合全局版,也就是APP+web ,里面用的是测量ID,测量ID的结构是GTM-*****
Global Site Tag

Global Site Tag

 

  • 2019年10月,Attribution Module做升级,进入测试阶段。
  • 2019年12月,增加电商功能。

正式推出GA4(混合全局版)

  • 2020年10月,APP+Web改名为Google Analytics 4 正式发布,Google Analytics 4有很多的亮点,详细的请看:Google Analytics 4(APP+Web)的几个亮点
  • 2021年8月,内部推出Google Analytics 4 的360,采用固定价格和阶梯定价的方式,更灵活。
  • 2022年4月,Google Analytics 4 360版本定价公布,5万美元/起步。
  • 2022年11月,公布GA4 API限额,会影响API和Looker Studio,基本上就是引导用户去使用BigQuery。
  • 2023年7月,所有免费版Universal Analytics 媒体资源都将停止处理新匹配,现在再分批停止了。
  • 2024年7月,所有付费版Universal Analytics 媒体资源都将停止处理新匹配。

 

不同版本的跟踪代码对比

版本 GA1 GA2 GA3 GA4
别名 经典版 统一版
加载的js urchin.js ga.js analytics.js gtag.js
ID Tracing ID
(UA-*****-1)
Tracing ID
(UA-*****-1)
Tracing ID
UA-*****-1)
Tracing ID(UA-*****-1)过渡版
Measurement ID(G-*****)
协议版本号 1 1或2

 


如有疑问,可以在文章底部留言或邮件(haran.huang@ichdata.com) 我~

我们要如何帮助您?

发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址