> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/server-side/concepts/experience-continuity.md).

# Experience Continuity

### What is Experience Continuity

Experience Continuity enables you to customize and track a visitor's experience **from anonymous (before they log in) to logged in state**.

With Experience Continuity, you can change your visitor ID from an anonymous ID (such as a session ID) to an authenticated ID (such as database ID), **without changing their experience and duplicating their tracking**. This enables cross-device authenticated experience without compromising on cross-session experience continuity.

### How does it work?

For Experience Continuity to work, you need to tell Flagship which authenticated visitor corresponds to the anonymous visitor once they log in. You can do this using the **`anonymous_id` and `visitor_id`** body fields in the Decision API, or the SDK's  **`authenticate`  method.**

When calling `authenticated` on an SDK visitor instance, you indicate that the current visitor ID was actually an `anonymous_id`, and that the new `visitor_id` is the authenticated visitor ID. On the next call to `synchronizeModifications`, the SDK will send both IDs in the request body to the Decision API.

### Decision API flow

When the Decision API receives both IDs (anonymous and authenticated), it follows these flows:

* It checks whether the authenticated visitor has already been assigned a variation for the experiment, for example, on another device or in another session. If so, the previously assigned variation is returned, ensuring that the **experience remains consistent for the authenticated visitor across devices**.
* If it is the first time the visitor is authenticated, the Decision API links the authenticated experience with the previously assigned anonymous ID variation and returns the already assigned variation. This way, the **cross-session anonymous/logged-in experience is kept**.

For details on how to use `anonymous_id` in Decision API calls, see the [Decision API Docs](https://docs.abtasty.com/server-side/decision-api/decision-api.md#experience-continuity).

### Limitations

#### Decision Mode

The Experience Continuity feature is only available with the cloud Decision API because it requires persistent storage of the link between the anonymous and authenticated IDs.

{% hint style="info" %}
**Bucket Allocation:** Experience Continuity is not compatible with Bucket Allocation. After logging in, a visitor may enter or leave a campaign that uses Bucket Allocation. Avoid using both features in the same campaign.
{% endhint %}

### How to enable Experience Continuity ?

The use of this feature requires having the option enabled in your Flagship account beforehand. Select the desired environment and go to /settings/environment-settings and enable the "Experience Continuity" option.

<figure><img src="https://233132171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBWu23t7Qv6wLLh6Hl5b4%2Fuploads%2Fgit-blob-36bd80eb48b976bab801088643e339f09e7f616a%2Fhttps___files.readme.io_404c8df-Capture_decran_2023-07-11_a_14.16.22.avif?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.abtasty.com/server-side/concepts/experience-continuity.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
