
Privacy protection regulations may require that you let the visitors on your website decide that they don't want their activity history to be tracked and associated with their browser or device and let the mobile app users decide that they don't want their activity history to be tracked in the application.

In Synerise, you can do this by:
- [creating a cookie](#enabling-do-not-track) that tells our SDK to stop tracking visitor activity, but you can still serve campaign content to those visitors (variant of the do not track feature for web SDK)
- enabling the do not track method that tells our SDK to stop tracking mobile app user activity (variant of the do not track feature for mobile SDK).

## Main assumptions

### Web

If the do-not-track cookie exists:
- With each page refresh, the Web SDK generates a random UUID.  
    This UUID isn't saved in the database or associated with a profile. It's only need for Dynamic Content requests.  
    
  <div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

  Don't use the random UUID as a profile identifier in API requests!

  </div></div></div>

- No Synerise cookies are created.
- Dynamic Content is only displayed if:
    - the audience is set to "everyone"
    - Jinjava inserts in the content don't require a profile context
- Only Dynamic Content with the audience set to "everyone" is displayed.
- Using SDK methods doesn't generate any events.
- The SDK doesn't automatically generate any tracking events (such as `page.visit`).
- If the cookie is deleted, tracking is re-enabled after the page is refreshed.
    In such cases, you should make it possible for a visitor to opt-out again.

### Mobile SDK

Tracking is disabled by running the do not track method. 

If the do not track method is executed, then Synerise mobile SDK works in the following way:
- A new random UUID will be generated for the token stored in the mobile app, however a proile isn't created. This may affect the API implementation. In such case, review what API endpoint they use and adjust accordingly (some endpoints may create profile in Synerise, in such case the call should not be performed).
- IP and uuid will be available on our access log.
- Using SDK methods doesn't generate any events.
- The SDK doesn't track any user activity in a mobile app, so the events won't be generated (such as `screen.view`).
- If the tracking is re-enabled after the application is reopened, you should make it possible for a mobile app user to opt-out again.

## Impact of Do Not Track on features
---

| Feature                                                                                                                              | Do Not Track enabled                                                                                                                                                                                                                                                    |                     
|--------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Client login methods                                                                                                                 | <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/close-s.svg" class="icon" alt= "Red checkmark"> |
| [Web push notifications](/docs/campaign/Webpush) (web) /[Push notifications](/docs/campaign/Mobile) (mobile)                       | <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/close-s.svg" class="icon" alt= "Red checkmark"> <br> If the token exists, it will be removed from the profile, which prevents sending notifications;  |
| [Dynamic content](/docs/campaign/dynamiccontent) (web) / [In-app messages](/docs/campaign/in-app-messages) (mobile)                | <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/check-s.svg" class="icon" alt="Green checkmark"> but: <br> - Capping won't work, <br> - ABx testing or control group assignment won't work, <br> - **[Global control group](/docs/settings/configuration/global-control-group) behavior for dynamic content**: doesn't work; a user with enabled do not track option will be displayed dynamic content only if the content is set to **Everyone** and/or the **Include first visitors** setting is enabled <br> - **[Global control group](/docs/settings/configuration/global-control-group) behavior for in-app messages**: global control group won't work for users with enabled do not track option <br> - Interactions with dynamic content and in-app messages are not tracked, <br> - Jinjava is rendered as for an anonymous profile |
| [Documents](/docs/assets/documents) and [screen views](/docs/campaign/screen-views)                                                | <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/check-s.svg" class="icon" alt="Green checkmark"> but: <br> - Activities are not tracked (such as generating `screen.view` events), <br> - Jinjava is rendered as for anonymous profile |
| [AI Search](/docs/ai-hub/ai-search)                                                                                                        | <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/check-s.svg" class="icon" alt="Green checkmark"> but: <br> Search results will be returned as for an anonymous profile  |
| [Jinjava: catalogs](/developers/inserts/insert-usage#catalogs)                                                                      | <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/check-s.svg" class="icon" alt="Green checkmark"> |
| [Jinjava: aggregates](/developers/inserts/insert-usage#aggregates) and [expressions](/developers/inserts/insert-usage#expressions) | <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/close-s.svg" class="icon" alt= "Red checkmark">                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Jinjava: vouchers](/developers/inserts/insert-usage#code-pools)                                                                    | <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/check-s.svg" class="icon" alt="Green checkmark"> but: <br> - `Assign=false` flag does not work, <br> - [Event of assigning voucher](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) will not be generated                                                                                                                                                                                                                                            |
| [Jinjava: promotions](/developers/inserts/insert-usage#promotions)                                                                  | <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/close-s.svg" class="icon" alt= "Red checkmark">                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Jinjava: recommendations](/developers/inserts/insert-usage#recommendations)                                                        | <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/check-s.svg" class="icon" alt="Green checkmark"> but: <br> - Recommendations implemented using Jinjava are rendered as for an anonymous profile, <br> - Interactions with recommendations are not tracked.                                                                                                                                                                                                                                                             |

## Enabling Do Not Track

### Web


<div class="admonition admonition-warning"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Before enabling the feature, make sure you know the [main assumptions](#main-assumptions) and [impact on the features](#impact-of-do-not-track-on-features).

</div></div></div>


1. Decide the cookie name:
    - If you want to use the default `_snrs_dnt` cookie, go to step 2.
    - If you want to use a different cookie, add its name to the SDK initialization script, in the `dntCookieName` variable:
    
      <div class="highlight-code-block" data-hl-lines="3">
      <pre><code class="language-js">SR.init({
          trackerKey: "xxxxxxx",
          dntCookieName: "your_cookie_name"
      });</code></pre>
      </div>

2. When a visitor rejects the category of cookies where you include Synerise:  
    1. Create the do-not-track cookie with a value of `1` or `true`
    2. Force refreshing the page to enable Do Not Track.

**Result**:  
After the page refreshes, Synerise JS SDK deletes all its cookies and local storage.

### Mobile

1. Make sure that the API key you're using has the `API_PERSONAL_DEVICE_CLIENT_DELETE` permission.  
    To learn about setting permissions, see [API keys](/docs/settings/tool/api#editing-api-keys).
2. Enable Do Not Track feature can be enabled in one of the following ways:
   - By defining the following parameter to `true` in the settings of the application (this can be defined at any moment): 

       
     <div class="content-tabs" data-tab-group="tabgrp-1232">
     <div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1232-0" data-tab-group="tabgrp-1232" data-tab-active="true">Android</button><button class="tab-button" data-tab-id="tabgrp-1232-1" data-tab-group="tabgrp-1232">iOS</button></div>

     <div class="tab-panel" data-tab-id="tabgrp-1232-0" data-tab-group="tabgrp-1232" data-tab-active="true">

     | Parameter | Type | Default |
     | --- | --- | --- |
     | `Synerise.settings.sdk.setDoNotTrack(true)` | `Boolean` | false |

     </div>

     <div class="tab-panel" data-tab-id="tabgrp-1232-1" data-tab-group="tabgrp-1232">

     | Parameter | Type | Default |
     | --- | --- | --- |
     | `Synerise.settings.sdk.doNotTrack` | `Bool` | false |

     </div>
     </div>


   - By applying the following method during the initialization of the application; this method lets you set the initial value of the Do Not Track feature to any value (true or false); 
       - This is a one-time setting that is only applied during the first initialization; **not** each time the application starts.
       - If you need to change this setting later, you can do so by adjusting the parameter mentioned in the previous point.  
       - If the parameter has already been set to false (as described in the previous point), any modifications made using the method during initialization will not impact the Do Not Track status.

       
         <div class="content-tabs" data-tab-group="tabgrp-1233">
         <div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1233-0" data-tab-group="tabgrp-1233" data-tab-active="true">Android</button><button class="tab-button" data-tab-id="tabgrp-1233-1" data-tab-group="tabgrp-1233">iOS</button></div>

         <div class="tab-panel" data-tab-id="tabgrp-1233-0" data-tab-group="tabgrp-1233" data-tab-active="true">

         `.initialDoNotTrack(true)` in the application [Builder](/developers/mobile-sdk/class-reference/android/lifecycle#synerise-builder)

         </div>

         <div class="tab-panel" data-tab-id="tabgrp-1233-1" data-tab-group="tabgrp-1233">

         <pre><code class="language-plaintext">let config = InitializationConfig()
               config.initialDoNotTrack = true

               Synerise.initialize(apiKey: clientApiKey, baseUrl: syneriseBaseURL, config: config)</code></pre>

         </div>
         </div>

