> 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/developer-guide/consent-javascript-sdk/reprocessing-in-the-consent-javascript-sdk.md).

# 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**:

```javascript
javascriptCopyEdit// 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.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.jentis.com/developer-guide/consent-javascript-sdk/reprocessing-in-the-consent-javascript-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
