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

Reprocessing in the Consent JavaScript SDK

The Consent JavaScript SDK includes a powerful feature called reprocessing. This allows JENTIS to re-evaluate and re-trigger tracking commands whenever consent information is updated—without requiring a full page reload.

Reprocessing ensures that any previously triggered commands are executed (or withheld) according to the latest consent state for a given vendor.

How Reprocessing Works

  • Reprocessing occurs only when the page scope remains the same.

  • If the page is reloaded, the JavaScript scope is reset, and all tracking starts fresh.

  • All JENTIS States—such as track:event, track:submit, or any other custom state, are stored temporarily.

  • When consent for a tool (vendor) changes, these stored commands are reprocessed to match the new consent decision.

Example: If a user initially denies consent for Analytics, but later accepts it, previously triggered events (e.g., a track:pageview) can be reprocessed so they are now sent to Analytics.

Special Case: Single Page Applications (SPAs)

For SPAs (e.g., React, Vue, Angular), navigation within the app also resets reprocessing. This means:

  • Even if an event is still available in memory, JENTIS clears its internal cache on navigation.

  • JENTIS treats SPA navigations and regular page reloads the same—no reprocessing occurs unless explicitly configured otherwise.

Controlling Reprocessing Reset

You can control whether navigation resets the reprocessing cache:

// Disable reprocessing reset (keep events across SPA navigations)
window.jentisApp.reprocessingCache_deactivate_reset();

// Enable reprocessing reset (default behavior)
window.jentisApp.reprocessingCache_activate_reset();

Default Behavior

  • By default, reprocessing reset is active → SPA navigations clear the cache.

  • To keep reprocessing active across navigations, call reprocessingCache_deactivate_reset() before JENTIS initializes.

When to Call the Reset Functions

Timing is critical:

  • In JENTIS: Use the trigger Before JENTIS Bundle Load.

  • In your own application: Call the function together with the JTM container code snippet.

✅ Tip: Use reprocessing strategically to ensure users’ updated consent choices apply instantly without losing valuable tracking data.

Issue: history.replaceState Executed After JENTIS Tracking

Some websites are configured to update or push the current URL to the browser's history stack late in the page lifecycle. When this occurs, the history.replaceState function runs after tracking has already been executed.

Under these conditions, the JENTIS Event Cache resets automatically. From a legal and compliance perspective, cached tracking events cannot be carried over or attributed to a newly updated page state.

How to Resolve This Issue

Choose one of the following approaches:

  • Execute Earlier: Adjust your website’s code to execute history.replaceState as early as possible in the DOM execution order (prior to JENTIS initialization).

  • Disable Reprocessing Logic: Deactivate the JENTIS cache-resetting logic so events are retained, following the configuration steps outlined in the documentation above.

Last updated

Was this helpful?