> For the complete documentation index, see [llms.txt](https://docs.jentis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jentis.com/data-activation/connectors/google-analytics-4/ga4-session-handling-and-essential-mode-for-data-consistency.md).

# GA4 Session Handling and Essential Mode for Data Consistency

In the dynamic field of digital analytics, maintaining data consistency and user privacy is crucial. Google Analytics 4 (GA4) introduced a robust set of session-related parameters that enable detailed tracking and analysis of user interactions. Designed for app tracking at first (also formerly known as Firebase Analytics) it was later migrated into a full blown digital analytics swiss knife, covering website analytics same as app data streams.

This documentation article explores how JENTIS, your server-side data capturing and tag management solution, leverages Essential Mode to handle GA4 session parameters with precision, ensuring data consistency and compliance with privacy regulations.

## Technical Foundations - GA4 Session Parameters <a href="#ga4sessionhandlingandessentialmodefordataconsistency-technicalfoundations-ga4sessionparameters" id="ga4sessionhandlingandessentialmodefordataconsistency-technicalfoundations-ga4sessionparameters"></a>

GA4 utilizes several session-related parameters to track user interactions accurately. These parameters are originally stored within app storage and are persisted on a user's device via cookies and local storage when GA4 is run in a website environment. Further, in the JENTIS context, all those are persisted server-side when GA4 is configured to run on the server. Thus, they are crucial for consistent reports and must be evaluated in light of each individual configuration and runtime.

These parameters include:

* **Client ID** (`cid`): A unique identifier for each “user” in accordance with reports and metrics. One client id (user) can have many sessions (1:n relationship). If a client-id changes (ie. when anonymized or pseudonymized) all session parameters must follow suit. So data remains consistent with all reports.
* **Event Counter** (`_s`): A sequential counter for events.
* **Session ID** (`sid`): A unique identifier for each session.
* **Session Count** (`sct`): The number of sessions a user has initiated.
* **Engaged Session** (`seg`): Indicates whether the session is engaged (ie. the user navigated further into the site or remained on page and time elapsed to a certain threshold).
* **User ID** (`_uid`): A unique identifier for logged-in users that you can use optionally, if configured it will have same implications as client-id (see above).
* **First Visit** (`_fv`): Indicates the user's first visit (new user).
* **Enhanced Client ID** (`ecid`): An enhanced version of the client ID, which is used in certain edge cases but generally must not be used for most cases. It is a hidden parameter under the hood of GA4 protocol and is not officially documented.
* **Session Start** (`_ss`): Indicates the start of a session.
* **Pageview Count and First Pageview Indication**: Essential for determining the correct session start.

## Essential Mode in JENTIS <a href="#ga4sessionhandlingandessentialmodefordataconsistency-essentialmodeinjentis" id="ga4sessionhandlingandessentialmodefordataconsistency-essentialmodeinjentis"></a>

Essential Mode in JENTIS is a framework designed to handle data capturing and tag management in scenarios where user consent is required. When Essential Mode is activated, you can configure JENTIS to only collect essential data, maintaining compliance with privacy regulations such as GDPR. Find out more: [Essential Mode](/jentis-dcp-elements/tags/how-to-configure-a-tag/essential-mode.md)

### Decision Tree: Handling GA4 Session Parameters in Essential Mode <a href="#ga4sessionhandlingandessentialmodefordataconsistency-decisiontree-handlingga4sessionparametersinesse" id="ga4sessionhandlingandessentialmodefordataconsistency-decisiontree-handlingga4sessionparametersinesse"></a>

The following decisions in your configuration determine how to approach each scenario during configuration to get the best results for data consistency.

1. **Do you want to run GA4 on the server-side?**\
   JENTIS offers both client-side and server-side operation modes. In client-side operations, Google Tag (GTAG) will handle all session parameters for you, but Essential Mode is unavailable in this configuration (so data of denied consent will be missed entirely).

{% hint style="success" %}
If you decide to configure GA4 to run on the server side, continue reading this article.
{% endhint %}

2. **Do you wish to configure Essential Mode** ***(to get the full picture of your website traffic while maintaining principles of least privileges and data minimization, so it is secure and privacy-enhancing)?***\
   With Essential Mode, you’ll need to decide which parameters will be anonymized when consent is not granted. When using the JENTIS Platform, GA4 is implemented with your JENTIS account and server (container).\
   If you choose not to activate Essential Mode, JENTIS will configure your GA4 server-side tags as a default, ensuring consistent data (as only consented users data is captured).

{% hint style="success" %}
If you decide to activate Essential Mode, continue reading this article.
{% endhint %}

3. **Must Client-ID be obfuscated for your Essential Mode configuration?**\
   In the scenario of GA4 server-side tags and active Essential Mode configuration, it is crucial to apply the correct session handling properties.\
   If client-id is neither anonymized nor pseudonymized, then it will be the same value in regular (consent mode) and with the fallback (Essential Mode) configuration, so data will remain consistent in that case (which means no special todo applies here).

{% hint style="success" %}
If you wish to anonymize or pseudonymize the client ID with Essential Mode configuration, please read on in the corresponding sections below.
{% endhint %}

When Essential Mode is activated, it is crucial to set GA4 session parameters with great care to ensure data consistency. While the most important foundation remains the Client ID, which is from our experience often configured with either anonymization or pseudonymization functions applied to improve data privacy, as the data can further not be traced back.

### Client ID Options <a href="#ga4sessionhandlingandessentialmodefordataconsistency-anonymizedclientid" id="ga4sessionhandlingandessentialmodefordataconsistency-anonymizedclientid"></a>

With Essential Mode active a GA4 tag options regarding "User session" look like this - where the Client ID is the most important identifier for data consistency in GA4 reports:

<figure><img src="/files/Rl8SucGlXISlYFTMP6zj" alt=""><figcaption></figcaption></figure>

Based on your requirements chose any of these options:

* Anonymized Client ID:\
  In this case, the Client ID value will be randomly generated for each individual event tracked with GA4. Thus, data can only be used to estimate traffic volume by event count but not by session or user count. In this case, you might want to configure a different measurement ID (new GA4 property) so this data does not pollute your general reports (where users consent and consistent Client ID values can be used).
  * Apply anonymization to the client-id variable and keep all other variables as they are set by default.
* Pseudonymized Client ID:\
  In this case a random Client ID value will be generated once for a user JENTIS recognized and from there on the same Client ID will be re-used with all following events, giving GA4 the chance to compute meaningful reports.
  * By default all other variables (such as Session ID, Session Count, etc.) will hold a variable that fits the same pseudonymization approach, so the Session ID is consistent with the Client ID.
* Same Client ID with and without Consent (no Pseudo- or Anonymization is applied)
  * If you chose to not generated different Client-IDs for Essential Mode tags you must also select the same variabels for all User session variables (do not use "GA4 Event Counter (Pseudonymized)" variable but the "GA4 Event Counter" variable instead with Essential Mode); so the data is consistent across Essential Mode and regular tracked tags.

## Conclusion <a href="#ga4sessionhandlingandessentialmodefordataconsistency-conclusion" id="ga4sessionhandlingandessentialmodefordataconsistency-conclusion"></a>

Handling GA4 session parameters precisely is essential for maintaining data consistency and compliance with privacy regulations. JENTIS’ Essential Mode provides a robust framework for managing these parameters, ensuring that data collection remains accurate and reliable, even when user consent is denied and you wish to further anonymize data with pseudonymized Client IDs. By leveraging server-side data capturing and tag management, JENTIS enables organizations to gain valuable insights while respecting user privacy.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jentis.com/data-activation/connectors/google-analytics-4/ga4-session-handling-and-essential-mode-for-data-consistency.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
