Server-Side Variables
Last updated
Was this helpful?
Server-Side Variables in JENTIS enable you to create, read, update, and delete persistent information stored in the JENTIS Runtime Environment on our proprietary TWIN-Browser.
These variables are designed for advanced use cases where data persistence, cross-request consistency, or enhanced data enrichment is required.
Unlike client-side variables that run in the user’s browser, server-side variables execute within the TWIN-Browser—a virtual browser environment hosted by JENTIS. This enables you to store and manage data across sessions, events, and user interactions in a secure, server-controlled context.
Server-side variables are particularly useful for:
Storing identifiers
e.g., user-id, client-id, session identifiers
Counting occurrences
e.g., hit-counter, session-counter, custom goals
Persisting campaign parameters
e.g., gclid, fbclid, or other marketing UTM tags
Persistent data storage Stored in JENTIS’ TWIN-Browser, across sessions and interactions.
Cross-variable interaction Server-side variables can access values from client-side variables.
Modern JavaScript support These variables run in a Node.js environment, so you're free to use modern JavaScript (ES6+) syntax and features.
Asynchronous execution
Server-side variables must be defined with the async keyword, as operations like reading and writing storage are asynchronous.
In this example:
A user ID (cid) is read from the persistent storage.
If no value is found, a new one is generated.
The ID is then stored with a future expiration (3 years).
Finally, the value is returned for use in your tracking logic.
Last updated
Was this helpful?
Was this helpful?
async function() {
let cid = this.userStorage.read("cid");
if (cid === false || cid === null) {
cid = Math.round(2147483647 * Math.random());
}
this.userStorage.write("cid", cid, Date.now() + 94608000000); // 3 years
return cid;
}