For the complete documentation index, see llms.txt. This page is also available as Markdown.

User Storage

userStorage API (Server-Side)

The this.storage function is our deprecated method for accessing User-Storage! Internally, calls to this.storage are forwarded to this.userStorage. While it should no longer be used in new code, it remains fully functional for backward compatibility.

The userStorage API is the primary interface for persisting data server-side per tool instance for a specific user. It is commonly used to store identifiers such as:

  • Client IDs (e.g., client_id)

  • Click IDs (e.g., gclid, fbclid)

  • Campaign parameters or session-level values

These functions are available within the server-side variable runtime environment under the this scope.

Looking for a practical use case how to put your server side storage into use? See here: Persist User Data for Google Ads Enhanced Conversions.


Available Functions

1. this.userStorage.write(name, value, expirationTimestamp)

Stores a value under a given key and defines when it should expire.

Parameters

Placeholder
Description
Type
Required
Example

<NAME>

The key used to store and retrieve the value

string

"client_id"

<VALUE>

The value to be stored (can be any data type)

any

"123abcd123.11111111"

<EXPIRATION TIMESTAMP>

Unix timestamp (in milliseconds) for automatic expiration

number (milliseconds)

1740555149453

Example


2. this.userStorage.read(name)

Reads a stored value from user storage based on the given key.

Parameters

Placeholder
Description
Type
Required
Example

<NAME>

The key under which the value is stored

string

"gclid"

Example


3. this.userStorage.delete(name)

Deletes a stored value from user storage by key.

Parameters

Placeholder
Description
Type
Required
Example

<NAME>

The key under which the value is stored

string

"gclid"

Example


Best Practices

  • Always set a realistic expiration for stored values to prevent unnecessary data buildup.

  • Combine client-side values with server-side logic for advanced tracking use cases.


Summary

The userStorage API enables persistent, scoped storage for identifiers and session-related data inside server-side variables. It offers a simple but powerful interface to write, read, and delete values securely within the JENTIS TWIN-Browser runtime.

For additional guidance or complex implementations, please refer to the Server-Side Variable Guide or contact JENTIS Support.

Last updated

Was this helpful?