How to check and interpret the consent cookie
Our app is a critical application for Shopify stores, ensuring that user consent is obtained and recorded in compliance with GDPR regulations. This guide provides a step-by-step process to check and interpret the consent cookies stored by the app.
Step 1: Locating the Consent Cookie
When a user gives consent, the app stores this consent in a cookie named "_pandectes_gdpr." This cookie contains base64 encoded information about the user's consent.
How to Access the Cookie
Open your web browser’s developer tools. This can usually be done by right-clicking on your website and selecting "Inspect" or pressing F12 or Ctrl+Shift+I on your keyboard.
Navigate to the 'Application' tab.
In the left sidebar, under the 'Storage' section, click on 'Cookies' and select your website.
Look for the cookie named "_pandectes_gdpr."
Step 2: Decoding the Cookie
The value of the "_pandectes_gdpr" cookie is base64 encoded. To decode it:
Copy the value of the "_pandectes_gdpr" cookie.
Open the console tab in your developer tools.
Type window.atob("COPIED_COOKIE_VALUE") and press Enter.
The console will display the decoded value.
Step 3: Interpreting the Decoded Value
The decoded value of the cookie will be in the following format:
id: "UNIQUE_CONSENT_ID" preferences: DECIMAL_VALUE status: "allow" / "deny" / "custom" timestamp: TIMESTAMP
Understanding the Fields
ID: This is the unique consent ID assigned to the user’s consent.
Preferences: This is a decimal value (ranging from 0 to 7) representing a 3-bit bitwise value. Each bit corresponds to a category of consent:
Bit at position 0 (least significant bit): Functionality.
Bit at position 1: Performance.
Bit at position 2 (most significant bit): Targeting.
Status: Indicates the consent status:
Allow: All categories are accepted.
Deny: All categories are declined, except for strictly required cookies.
Custom: The visitor has accepted some but not all categories.
Timestamp: The Unix timestamp indicating when the consent was given.
Decoding the Preferences
Each bit in the preferences value represents the user’s consent for a specific category. A bit set to 1 means consent is rejected for that category. For example:
A value of 0 (binary 000) means consent is given for all categories.
A value of 5 (binary 101) means consent is rejected for Functionality and Targeting, but given for Performance.
Understanding and interpreting the consent cookies set by the app is essential for Shopify store owners. By following these steps, store owners can ensure they are correctly reading and respecting the consent preferences of their visitors, maintaining compliance with GDPR.
Updated on: 20/11/2023