# Cookie Wall Settings

## Storage Types & Purpose

#### First Party Cookie

The cookie \_crbx is a **first party cookie**, and will not be used outside of our client’s domain. As a default the \_crbx cookie is set as a temporary “*session*” cookie, meaning that it is automatically removed after the browser is closed. It is necessary in order to keep a consistent experience for the visitor, also in case our client uses subdomains. Visitors will be able to see and use the Crobox functionality, but will not be included in analytics data, will not see any AB test variants, and no data will be persisted in connection to that session.

If consent is given by the visitor, or not needed according to our client's cookie policy, the cookie will be set as a “*persistent*” cookie, which will expire after the set time by our client (default 180 days). It is then used for *aggregated* analytics & AB testing and to remember a given consent. It is in no way used for tracking or marketing purposes. A returning visitor will not see any pre-filled information or content based on information given in a previous session.

#### Temporary Local & Session Storage

Crobox makes use of *necessary*, non-persistent local and session storage. Local storage is needed for when the visitor uses multiple browser tabs, but is treated as *temporary*. Once the visitor closes their browser, both storage types will expire, and no data connected to the session, excluding explicit opt-out information, is persisted without proper consent.

## Visitor’s Consent - Website Integration Instructions

If your cookie policy requires an explicit consent to store data for analytics (and AB testing), turn on the setting “Opt-in needed to persist visitor data” in your website integration general settings, and make sure that in any case the [Crobox snippet](/getting-started/first-steps/get-started-with-crobox.md) is loaded and [events like pageview](/getting-started/first-steps/event-tracking-implementation.md) are sent on page load or visitor action. No data will yet be persisted beyond the session. Only after the consent has been given, the events that were sent to Crobox will be persisted (anonymously) for analytics purposes.

Call the Opt-in Javascript event, described below, for visitors that have given the consent.

#### Opt-in: set \_crbx Cookie on Explicit Consent

Needed if according to your cookie policy you require explicit consent for analytics or AB testing. When the user gives the consent on your platform, call the Opt-in Javascript event as followed:

```
const crobox = window.crobox || [];  
crobox.push(crobox => crobox.optIn());
```

{% hint style="info" %}
Ideally this Opt-in event is called in a routine that looks at the consent state of your visitor, and not directly on a button click event in your cookie banner. This is because your cookie banner might not be shown anymore to returning visitors for a longer period than the Crobox persistence time, for example because of stricter expiration rules that are enforced by browsers like Safari.
{% endhint %}

{% hint style="info" %}
It is only needed to call this method once (for example when visitors are accepting cookies, or denying them), so there is no need to call them every time the page loads.
{% endhint %}

#### Opt-out: Revoke Explicit Consent

To opt-out for a previously given consent, call the Opt-out Javascript event as followed:

```
const crobox = window.crobox || []; 
crobox.push(crobox => crobox.optOut());
```

#### Loading the Crobox snippet after consent in the cookie banner

It is advised to load the [Crobox snippet](/getting-started/first-steps/get-started-with-crobox.md) and send [events like pageview](/getting-started/first-steps/event-tracking-implementation.md) in any case (see above). Otherwise, functionally for which no consent is needed cannot be shown to the visitor’s first, and most important, the landing page. In case the Crobox snippet can only be loaded after a consent in the cookie banner, be sure that the snippet is loaded and the [pageview event](/getting-started/first-steps/event-tracking-implementation.md) for that page is called on consent action (f.e. In the cookie banner), and not on the next page load. Otherwise the visitor that gave the consent will be missed out on these important landing pages, both functionally and in analytics data.

## No Explicit Consent Needed for Analytics Cookies

If you do not require an explicit consent for analytics cookies, turn off “Opt-in needed to persist visitor data” in your website integration general settings, and make sure the [Crobox snippet](broken://pages/-M6FUW6WSbCe2A-VNFxm) is loaded in any case. The cookie will now be default set without further implementation requirements.

## FAQs

<details>

<summary>Why don't my experiences show up right after users accept cookies?</summary>

When you load the Crobox snippet after consent, experiences won't appear until the next page load—unless you manually trigger a pageview event. After loading the snippet, call `crobox.push(crobox => crobox.pageView());` to ensure your experiences appear immediately. This tells Crobox about the current page so it can show relevant content right away.

</details>

<details>

<summary>How can I verify my cookie consent setup is working properly?</summary>

Open your browser's developer tools and check the Network tab for "crobox" requests. After users accept cookies, you should see Crobox network activity immediately—no page refresh needed. If requests only appear after refreshing, the pageview event isn't firing correctly when the snippet loads.

</details>

## Next step

If your website enforces a Content Security Policy, continue with [Content Security Policy Header](/getting-started/first-steps/content-security-policy-header.md).

That shows which Crobox domains and directives to allow.


---

# Agent Instructions: 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:

```
GET https://docs.crobox.com/getting-started/first-steps/cookie-wall-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
