Google Analytics 4 (GA4)

Google Analytics

Google Analytics is a web analytics service offered by Google that tracks and reports website traffic and also the mobile app traffic & events, currently as a platform inside the Google Marketing Platform brand. Google launched the service in November 2005 after acquiring Urchin

Google Analytics provides an SDK that allows gathering usage data from iOS and Android app, known as Google Analytics for Mobile Apps

Helps you understand your website.Google Analytics is a tool that helps you track your digital marketing performance. Its features allow you to view how your audience found your website, what they do while visiting your site, and more.

Google Analytics is used to track website activity such as session duration, pages per session and the bounce rate of individuals using the site, along with the information on the source of the traffic. It can be integrated with Google Ads, with which users can create and review online campaigns by tracking landing page quality and conversions (goals).

Google Analytics has undergone many updates since its inception and is currently on its 4th iteration — GA4.GA4 is the default Google Analytics installation, and is the renamed version for the (App + Web) Property that Google released in 2019 in a Beta form. GA4 has also replaced Universal Analytics (UA). One notable feature of GA4 is a natural integration with Google's BigQuery — a feature previously only available with the enterprise GA 360. This move indicates efforts by Google to integrate GA and its free users into their wider cloud offering.

Google Analytics e-commerce reporting can track sales activity and performance. The e-commerce reports show a site's transactions, revenue, and many other commerce-related metrics

Date line

  1. 2005, Google aquires Urchin Analysis
  2. 2006, Google makes it available fee for all.JS code delayed page loading, so code was to be put at the end og the page , just before closing body tag.
  3. 2011, new version of Google Analytics featuring multiple dashboards, more custom report options, and a new interface design
  4. 2012, another new version of Google Analytics was announced, called Universal Analytics.The key differences from the previous versions were: cross-platform tracking, flexible tracking code to collect data from any device, and the introduction of custom dimensions and custom metrics
  5. 2016, Google released Google Analytics 360, which is a software suite that provides analytics on return on investment and other marketing indicators. Google Analytics 360 includes seven main products: Analytics, Tag Manager, Optimize, Data Studio, Surveys, Attribution, and Audience Center
  6. 2017, a new methodology to collect data for Google Analytics was announced, called Global Site Tag, or gTag.js. Its stated purpose was to unify the tagging system to simplify implementation. This new tag type is an alternative to the existing Analytics.js tag type or Google Tag Manager.
  7. 2018, Google introduced Google Marketing Platform, an online advertisement and analytics brand.[37] It consists of two former brands of Google, DoubleClick Digital Marketing and Google Analytics 360
  8. 2020, Google released Google Analytics 4, under the acronym GA4.The new code can be placed between the <head> ... </head> HTML head tags because, once triggered, it runs in parallel with page loading.Instead of being "hit-based," like Universal Analytics, GA4 is "event-based."

Technology

Google Analytics is implemented with "page tags", in this case, called the Google Analytics Tracking Code,[42] which is a snippet of JavaScript code that the website owner adds to every page of the website. The tracking code runs in the client browser when the client browses the page (if JavaScript is enabled in the browser) and collects visitor data and sends it to a Google data collection server as part of a request for a web beacon.

Universal Analytics

Universal Analytics highlights Total Users (shown as Users) in most reports, whereas GA4 focuses on Active Users (also shown as Users). So, while the term Users appears the same, the calculation for this metric is different between UA and GA4 since UA is using Total Users and GA4 is using Active Users.

Tracking code

UA introduced three new tracking codes to help users gather more useful insights about their website visitors:

  1. Analytics.js - This is a code that measures how users interact with your website.
  2. Google Analytics SDKs - This code is designed for mobile tracking.
  3. Measurement Protocol - This collects data from other devices, including game consoles

Implementation

Universal Analytics

Add following code just before closing body tag.

<SCRIPT src="js/tagdiv_theme.js" type="text/javascript"></SCRIPT>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1565652-1";
urchinTracker();
</script>

GA4

Add following Code inside head tag

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-RZSEDBS25C"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-RZSEDBS25C');
</script>

Differences

# UA GA-4
1 Cookie No Cookie
2 Session Based Event Based
3 Seperate for Website and App Same