Cookie3 Docs
  • πŸ‘‹Introduction
  • πŸ‘‰Register your account
  • πŸ”ŒSetup your site or app
    • 1️⃣Add your website or app
    • 2️⃣Install Cookie3 snippet in your website or app
    • 3️⃣Installation guide
      • ⚑Integration with Google Tag Manager (GTM)
    • 4️⃣Verifying installation status
    • 5️⃣Security measures
    • 6️⃣Setup in-app custom events
    • 7️⃣Setting up consent management
    • How to retrieve your siteID?
    • ↗️Upgrading the snippet version
      • Troubleshooting
  • πŸ‘©β€πŸ’ΌAdd your team members
  • πŸͺFeatures
    • πŸ“ˆOnchain Explorer
      • Filters
      • Supported blockchains
      • Charts & metrics
      • Data export
      • CSV import
      • Audiences
    • πŸ•ΈοΈWeb Analytics
      • Selecting a website or app
      • Filters
      • Onchain reporting
      • Acquisition report
        • πŸ”ŽData dimensions
        • πŸ“ˆKey metrics
      • Conversions report
        • πŸ“ˆKey metrics
        • πŸ’²Show attribution report per conversion event
    • πŸ’²Conversion Events
      • How our attribution works?
      • Onchain conversion events
        • Attributed USD Value
      • Offchain conversion events
      • Retrieving your Conversion Event unique ID
    • 🐦KOL Intelligence
      • Getting started
        • Organic KOLs and Lists
        • KOL Dashboard
        • Searchbar
        • KOL Activity Chart
          • Extending the chart with additional Metrics
        • Advanced Metrics
        • Performance Table
          • KOL metrics explained
        • Post Feed
      • Your KOLs
        • Importing KOL Lists
          • Understanding the loading status during KOL upload
        • Managing KOLs in a given project
        • KOL List summary
      • AI-powered KOL scoring system
      • Campaigns
    • πŸ“ŠToken Analytics
  • βš™οΈAPI
    • πŸŒ€Referral Systems
      • Setup referral tracking
      • Accessing leaderboard and user data
      • API Response schema
      • Best practices
      • FAQ
Powered by GitBook
On this page
  • Handling Consent Management with the window.cookie3 Object
  • Let Users Express Consent
  • Check if User Consented to Data Processing
  • Check if User Declined Data Processing
  • Remember User's Decline Decision Using Local Storage
  • Summary of Methods:

Was this helpful?

  1. Setup your site or app

Setting up consent management

To enable consent management in the Cookie3 Analytics snippet, ensure your script configuration in the tag includes this line: consent-required="true"

Handling Consent Management with the window.cookie3 Object

When handling consent management on your website using the window.cookie3 object, you have access to several methods that allow you to give users control over their tracking and cookie consent decisions. Here's how you can use these methods to implement consent management.

Let Users Express Consent

To let users express their consent for tracking and cookie usage, you can use the following method from window.cookie3. Call the setTrackingConsentGiven() method when the user agrees to tracking:

window.cookie3.setTrackingConsentGiven();

Check if User Consented to Data Processing

Before processing any data, it's essential to check if the user has already given their consent. You can check this using the isTrackingConsentGiven()method:

if (window.cookie3.isTrackingConsentGiven()) {
	// you can handle your custom consent banner logic here
	// for example: hiding not displaying the banner if the consent is given 
}

Check if User Declined Data Processing

If the user has explicitly declined tracking or cookie usage, you can detect this by checking the value returned by the isTrackingConsentGiven() method.

If the method returns false, it means the user has not consented to tracking (or has declined):

if (!window.cookie3.isTrackingConsentGiven()) {
  // The user has declined tracking consent
}

Remember User's Decline Decision Using Local Storage

When the user declines consent, you can remember their decision by using the forgetTrackingConsentGiven() method. This method store the user's decline decision in local storage, ensuring their preference is remembered across sessions:

window.cookie3.forgetTrackingConsentGiven();

By storing these decisions, the user's choice will be remembered and you won't need to ask for consent again unless the user clears their browser's local storage.

Summary of Methods:

  • Give consent:

    • window.cookie3.setTrackingConsentGiven()

  • Check consent:

    • window.cookie3.isTrackingConsentGiven()

  • Decline consent:

    • window.cookie3.forgetTrackingConsentGiven()

This consent management flow helps you comply with privacy regulations by giving users full control over how their data is handled, while remembering their preferences for future visits.

PreviousSetup in-app custom eventsNextHow to retrieve your siteID?

Last updated 8 months ago

Was this helpful?

πŸ”Œ
7️⃣