# Managing visitor consent

## 📖 Definition

Depending on the different privacy rules of each country (ie: GDPR and CNIL), **you may have a legal obligation to ask your visitors for their explicit consent before tracking them and collecting their personal information**.

A variable displayed in your SDK enables you to manage data collection, depending on whether a visitor accepts to be tracked or not.

Accepting to be tracked (data collection consent) generally means accepting a website’s cookies (often in the form of a banner).

## ⚙️ Configuration

Data collection can be managed via a parameter, directly in the SDK code of your Flagship implementation.

| <p>⭐ Good to know</p><p>The visitor consent parameter is available for the following SDKs:</p><ul><li>Android</li><li>iOS</li><li>Java</li><li>Flutter</li></ul> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### Variable set to *true*

By default, the *.withVisitorConsent* variable is set to ***true***, meaning that you will be able to collect visitor data. Don’t forget to change that default behavior if the visitor does not consent to data collection.\
Here is an example with the Android SDK:

![Visitor\_consent.png](/files/rWqXhmcb6dDQTpS5kLgE)

### Variable set to *false*

You can change this parameter to ***false*** to block the data collection when a visitor has not given their consent. In this case, a hit will be triggered to specify that this visitor didn’t consent to data collection.

Flagship will still be able to send data but won’t receive any from the visitor.

When setting the variable to *false*, you won’t be able to know if the visitor has been assigned to a flag and you won’t see the results of their actions on the website or application (if any).This parameter only impacts data collection, but has no effect on use cases display. Even if your variable is set to *false*, your visitors will still see the use cases they’re affected to.

To know the implementation methods according to your stack, please refer to our [technical documentation](https://developers.flagship.io/sdk/index.html).

| <p>⭐ Good to know</p><p>This option isn’t retroactive. If you have collected data before the variable was set to <em><strong>false</strong></em>, it won’t be deleted. However, new data won’t be collected.</p> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**Need additional information?**

Submit your request at [product.feedback@abtasty.com](mailto:product.feedback@abtasty.commailto:product.feedback@abtasty.com?subject=Flagship%20Custom%20Integration%20Feedback)

Always happy to help!


---

# 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.abtasty.com/flagship-deprecated/sdks-integration/managing-visitor-consent.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.
