GA4
  • 25 Oct 2022
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

GA4

  • Dark
    Light

 

This article version is deprecated. Please find here the latest version: https://docs.jentis.com/docs/ga4

Article Summary

Google Analytics 4 (formerly Firebase Analytics) is the successor of Google Universal Analytics (GA) of the Alphabet Inc. company - the parent of Google and several former Google subsidiaries. GA4 provides an analytics service for website traffic data that supports data streams from clients and server side via the measurement protocol version 2.

Official website: GA4

JENTIS - GA4 - Global Constants

Measurement IDYour GA4 Property Measurement ID, which is the identifier for a data stream in GA4 terms. You'll find it in the Google Analytics UI in: Admin > Data Streams > choose your stream > Measurement ID.
API Secret

Required for Measurement Protocol based data streams only. This is an API Secret key that is generated through the Google Analytics UI. To create a new secret, navigate in the Google Analytics UI to: Admin > Data Streams > choose your stream > Measurement Protocol > Create. We recommend that you keep these private to your organization.

Debug ModeActivate to monitor the event in GA4 DebugView. Please make sure to not publish a JTM Container version with this activated, as all productive traffic will be interpreted for DebugView and not processed in your reports.

JENTIS - GA4 Tag Types

Currently JENTIS Tag Manager supports the following tags with GA4.

S2S (Twin-Server): Pageview BETA

DescriptionJENTIS Data Layer - Default Dependencies

This tag is equivalent to the automatically collected "page view" from client side executed gtag.js - but as a stand alone server side component! So no client side executed third party library is involved. It will also handle all session related properties (engagement, session duration and expiration, etc). It is strongly recommended to use this tag in all server side GA4 configurations with JENTIS.



This tag will create the following data storages (cookies, local or session client side browser storages):

  • no data is explicitly stored or read on a users device (client side) specifically with this tag

The following default _jts push track calls are required for the default JENTIS GA4 implementation to work out of the box:

_jts.push track:

  • pageview
  • submit

Code example (do not execute or copy paste; for reference only).

function pageview() {
    _jts.push({
       "track" : "pageview"
    });

    _jts.push({
        "track" : "submit"
    });
}

S2S (Twin-Server): Custom Event BETA

DescriptionJENTIS Data Layer - Default Dependencies

Use this tag to further customize your GA4 configuration with JENTIS. By implementing custom events with GA4 next to the default events (https://support.google.com/analytics/answer/9267735?hl=en). However you are not limited to also use the same default events as the event value.


This tag will create the following data storages (cookies, local or session client side browser storages):

  • no data is explicitly stored or read on a users device (client side) specifically with this tag

There are no default dependencies defined for this tag that are required with the JENTIS data layer. Please use a custom trigger and state or default triggers from JENTIS that match your requirements.

C2S: GA4 - Global Site Tag BETA

DescriptionJENTIS Data Layer - Default Dependencies

This tag will initialize GA4 on a users device (client side) by loading gtag.js source from a third party location. With this tag configured in your JENTIS implementation you will activate all GA4 features that are configurable in the GA4 user interface for a data stream (ie. automatically tracking page views, scrolls and other events).

This tag will create the following data storages (cookies, local or session client side browser storages):

  • gtag.js library internal cookies can be set (this tag executes original source code from the third party, which gives this third party permission to access and store data on the users device)

_jts.push track:

  • pageview
  • submit 

Code example (do not execute or copy paste; for reference only).

function pageview() {
    _jts.push({
       "track" : "pageview"
    });

    _jts.push({
        "track" : "submit"
    });
}



Was this article helpful?

What's Next