Basic Cookie Consent Example

This example demonstrates the simplest implementation of Extended Cookie Consent.

Features Demonstrated

Controls

Status: Not initialized

Code Example

// Basic initialization
cookieconsent.extended.init({
  ui: {
    showPreferences: false,
    position: 'bottom-right'
  },
  content: {
    header: 'Cookie Notice',
    message: 'We use cookies to enhance your browsing experience and analyze our traffic.',
    acceptAll: 'Accept All',
    rejectAll: 'Reject All'
  },
  callbacks: {
    onAcceptAll: function(categories) {
      console.log('User accepted all cookies');
      updateStatus('All cookies accepted');
    },
    onRejectAll: function(categories) {
      console.log('User rejected all cookies');
      updateStatus('All cookies rejected');
    }
  }
});