# Consent Signal & Loyalty Exemption Guide

## Overview

The Advertiser Consent Signal allows advertisers to communicate consumer consent preferences to CJ regarding cookie usage and device access. CJ's Universal Tag (UT) will use this signal to align its behavior with consumer preferences.

Additionally, advertisers who implement the Consent Signal can also opt into the Loyalty Exemption feature, which allows the Universal Tag to disregard the Consent Signal when a consumer is engaged in a loyalty journey.

Prerequisites
  * Advertisers must fire the Universal Tag integration unconditionally.
  * Permission must be requested and granted to enable the Consent Signal functionality.
  * Only advertisers with the Consent Signal enabled can request the Loyalty Exemption feature.

## Implementation Process

##### Request Permissions <br>

Advertisers must formally request to:
  * Enable the Consent Signal.
  * Enable the Loyalty Exemption (optional, but requires Consent Signal to be enabled).

##### Technical Integration

1. Set the **Consent Variable**

   Advertisers must set the consent variable on every page before calling the Universal Tag:
```javascript
// The values '1' and '0' are also acceptable as equivalences for true and false, respectively.

// True & False

window.cj.advertiserConsentStatus = true;    //consent given

window.cj.advertiserConsentStatus = false;   //consent not given

// 1 & 0

window.cj.advertiserConsentStatus = 1        // consent given

window.cj.advertiserConsentStatus = 0        // consent not given
```

2. **Consent Management Platform (CMP)** Integration

   When a user makes a consent selection, the CMP should trigger the setConsentSignal function:
   
```javascript
// The values '1' and '0' are also acceptable as equivalences for true and false, respectively.

// True & False

window.cjApi.setAdvertiserConsentStatus(true);  //consent given

window.cjApi.setAdvertiserConsentStatus(false); //consent not given

// 1 & 0

window.cjApi.setAdvertiserConsentStatus(1);     //consent given

window.cjApi.setAdvertiserConsentStatus(0);     //consent not given

```
  * **It is the advertiser's responsibility to update _widow.cj.advertiserConsentStatus_ in accordance with the user's consent preferences.**

 3. Cookie Whitelisting Requirements

    To ensure proper functionality, advertisers must whitelist the following cookies:

  * _'cjConsent'_ cookie
  * All cookies started with the _'cj'_ prefix (recommended by default) 

## Verification Process

1. Inspect tag.js Configuration
  * Confirm _enableAdvertiserConsentSignal_ is set to _true_.
  * Verify _enableAdvertiserLoyaltyOverride_ value (true if Loyalty Exemption is enabled).

2. Check Consent Variable
  * Inspect _window.cj.advertiserConsentStatus_ in browser console.
  * Should be either _true_ or _false_ (if _undefined_, there is an integration issue).

3. Verify Device Access
  * In the browser's Developer Tools -> Network tab
  * In the *filter* tab, type *pageInfo*.
  * Check _isDeviceAccessGranted_ property in pageInfo request.

4. Confirm Cookie Creation
  * In the browser's Developer Tools -> Application tab
  * Click the cookie dropdown and verify _'cjConsent'_ cookie exists.
  * Decode cookie and check that is has a sixth parameter (possible values: _Y_, _N_, or _0_).

##### Troubleshooting

If the consent signal is not working as expected:

1. Ensure all JavaScript variables are set correctly before the Universal Tag is called. 
2. Verify cookies are properly whitelisted.
3. Check browser console for any errors related to CJ scripts. 
4. Confirm that _tag.js_ has the required configuration flags enabled. 

For additional technical assistance or questions regarding the consent & loyalty implementation, please contact your CJ Client Integration Engineer. 
