Persist User Data for Google Ads Enhanced Conversions
In many tracking scenarios, PII (like a hashed email) or other crucial data (like a networks click ID) is only available during a specific event (e.g., on landing page or on registration). To use this data for a later conversion event in any connector with JENTIS is a common use case.
In this guide we will describe this use case on example of Google Ads Enhanced Conversions, where the user provided data must be persisted on the server. Which improves data privacy and security. All implemented with your JENTIS Server Side tag management solution.
1. Persisting Data with Server-Side Storage
To store a value across a session, you must create a Server-Side JS Code variable.
In our example use case we assume an email-address value is available with a certain event. On this occasion it is observed and persisted server side, making it available for later events in a users session.
The Logic
The variable should perform three steps:
Check if the value exists in the current event (using this.getFrontendVariable).
Write the value to storage if it is present.
Read and return the value from storage if it is not in the current event.
Create a new server-side variable of type "Server Side Javascript Code". Use the following code to store and return the latest email-value from storage.

Code Example
Storage Types
You can use either the userStorage (as in the example) or a tool instance storage. Here are the key differences:
userStoragewill store the value in context of the connector-instance you configured, ie. with the Google Ads configuration; other connectors can't access the value. This is the most common use case. More infos on user storage.toolInstanceStoragewill store the value in context of the connector-instance the same but accessible to all events from all website visitors; ideally to store shared connector-level information that is shared across all sessions on your website. Do not use it for user-related information. More infos on tool instance storage.
2. Configuring Google Ads Enhanced Conversions
Once the variable is created, follow these steps in the JENTIS DCP:
Navigate to JENTIS Tag Manager -> Tags.
Configure a new tag with template "Campaign Linker" which will execute with the event where the email is observed. This is important to ingest the information into the storage.
We will override the general Campaign Linking purpose of this tag (which does the same for
gclidby default) now to store the email-information. You can select the newly created email-variable instead of the GCLID Variable:
Please note: This "Campaign Linker" tag is a vehicle to execute the variable on the right event. It will not send any data to Google yet, only execute the variables you configured with it.Trigger this tag with your event where the email value is observed.
Now when this tag executes the variable will read the email and store it on the server.
To finish this configuration you must also make use of that value within a conversion tag. Simply configure the same email-variable in the "Enhanced Conversion" tab.
Now the conversion will refer to the previously stored information.
3. Important Considerations
Server-Side Only: Data stored via this.storage is only accessible to JENTIS server-side tags. Client-side tags (like a standard GTAG implementation) cannot access this server-side storage.
Hashing: Ensure the data is already hashed (SHA256) before sending it to Google, or use the JENTIS ga_sha256() helper function if the input is clear text. Here is a guide on enhanced conversion data hashing with Google Ads.
FAQ
How long does the data stay in storage? You define the expiration in the write function (e.g., Date.now() + duration_in_ms).
Can I use this for other connectors? Yes, if you use Global User Storage, the data is available to all server-side connectors in that session.
Last updated
Was this helpful?