Shahi LegalFlowSuite

Configure Custom Consent Categories

Create Advanced Cookie Categories & Consent Mechanisms

Understanding Consent Categories

Default Categories Overview

Essential Cookies (Always Required):

    1. Strictly necessary for website functionality
    2. Cannot be disabled by users
    3. No consent required under GDPR/ePrivacy
    4. Analytics Cookies (Optional):

    5. Track website usage and performance
    6. Help improve user experience
    7. Require explicit consent
    8. Marketing Cookies (Optional):

    9. Used for advertising and retargeting
    10. Track users across websites
    11. Require explicit consent
    12. Preferences Cookies (Optional):

    13. Remember user preferences and settings
    14. Enhance user experience
    15. Require explicit consent
    16. Create Custom Categories

      Step 1: Access Category Management

      `
      SLOS → Consent Management → Cookie Categories → Custom Categories
      `

      Step 2: Define New Category

      Category Configuration:
      `json
      {
      “categoryid”: “socialmedia”,
      “name”: {
      “en”: “Social Media Cookies”,
      “es”: “Cookies de Redes Sociales”,
      “fr”: “Cookies de Réseaux Sociaux”
      },
      “description”: {
      “en”: “Enable social media features and integrations”,
      “es”: “Habilitar funciones y integraciones de redes sociales”,
      “fr”: “Activer les fonctionnalités et intégrations des réseaux sociaux”
      },
      “required”: false,
      “default_state”: “denied”,
      “cookies”: [
      {
      “name”: “facebook_pixel”,
      “domain”: “.facebook.com”,
      “purpose”: “Facebook advertising and analytics”,
      “retention”: “2 years”
      },
      {
      “name”: “twitter_pixel”,
      “domain”: “.twitter.com”,
      “purpose”: “Twitter advertising and analytics”,
      “retention”: “2 years”
      }
      ]
      }
      `

      Step 3: Set Category Rules

      Legal Requirements:

    17. Define legal basis (consent, legitimate interest, vital interest)
    18. Set retention periods
    19. Specify data processing purposes
    20. Configure data sharing rules
    21. Technical Rules:

    22. Define cookie patterns to include
    23. Set blocking mechanisms
    24. Configure loading conditions
    25. Set up fallback behaviors
    26. Configure Advanced Consent Mechanisms

      Step 1: Granular Consent Options

      `
      SLOS → Consent Management → Advanced Settings → Granular Consent
      `

      Multi-Level Consent:
      `javascript
      const consentLevels = {
      ‘basic’: {
      ‘analytics’: false,
      ‘marketing’: false,
      ‘social’: false
      },
      ‘standard’: {
      ‘analytics’: true,
      ‘marketing’: false,
      ‘social’: false
      },
      ‘full’: {
      ‘analytics’: true,
      ‘marketing’: true,
      ‘social’: true
      }
      };
      `

      Step 2: Contextual Consent

      Set up consent based on user actions:

      Scroll-Based Consent:
      `javascript
      // Auto-accept after scrolling
      document.addEventListener(‘scroll’, function() {
      if (window.scrollY > 100 && !window.consentGiven) {
      window.SLOS.acceptCategory(‘analytics’);
      }
      });
      `

      Time-Based Consent:
      `javascript
      // Auto-accept after time delay
      setTimeout(function() {
      if (!window.consentGiven) {
      window.SLOS.acceptCategory(‘preferences’);
      }
      }, 30000); // 30 seconds
      `

      Interaction-Based Consent:
      `javascript
      // Accept on form interaction
      document.querySelectorAll(‘form’).forEach(form => {
      form.addEventListener(‘focus’, function() {
      window.SLOS.acceptCategory(‘preferences’);
      }, { once: true });
      });
      `

      Set Up Conditional Cookie Loading

      Step 1: Category-Based Loading

      `javascript
      // Conditional script loading
      function loadScriptBasedOnConsent(category, scriptUrl) {
      if (window.SLOS && window.SLOS.hasConsent(category)) {
      const script = document.createElement(‘script’);
      script.src = scriptUrl;
      document.head.appendChild(script);
      }
      }

      // Load Google Analytics only with consent
      loadScriptBasedOnConsent(‘analytics’, ‘https://www.googletagmanager.com/gtag/js?id=GATRACKINGID’);

      // Load Facebook Pixel only with consent
      loadScriptBasedOnConsent(‘marketing’, ‘https://connect.facebook.net/en_US/fbevents.js’);
      `

      Step 2: Dynamic Content Blocking

      Block Marketing Content:
      `html

      `

      Block Social Widgets:
      `html

      `

      Configure Vendor Management

      Step 1: Register Third-Party Vendors

      `
      SLOS → Consent Management → Vendors → Add Vendor
      `

      Vendor Configuration:
      `json
      {
      “vendorid”: “googleanalytics”,
      “name”: “Google Analytics”,
      “category”: “analytics”,
      “privacy_policy”: “https://policies.google.com/privacy”,
      “cookie_table”: [
      {
      “name”: “_ga”,
      “domain”: “.example.com”,
      “purpose”: “Google Analytics tracking”,
      “retention”: “2 years”
      },
      {
      “name”: “_gid”,
      “domain”: “.example.com”,
      “purpose”: “Google Analytics session tracking”,
      “retention”: “24 hours”
      }
      ],
      “data_processing”: {
      “purposes”: [“analytics”, “measurement”],
      “legal_basis”: “consent”,
      “data_shared”: [“IP address”, “user agent”, “referrer”]
      }
      }
      `

      Step 2: Vendor Consent Management

      IAB TCF 2.0 Integration:
      `javascript
      // Check IAB consent for vendor
      function hasIABConsent(vendorId) {
      if (window.__tcfapi) {
      window.__tcfapi(‘getTCData’, 2, function(tcData, success) {
      if (success && tcData.vendor.consents[vendorId]) {
      return true;
      }
      });
      }
      return false;
      }
      `

      Set Up Consent Withdrawal

      Step 1: Withdrawal Mechanisms

      `
      SLOS → Consent Management → Withdrawal Settings
      `

      One-Click Withdrawal:
      `html

      Withdraw Consent
      `

      Category-Specific Withdrawal:
      `javascript
      // Withdraw specific category
      function withdrawCategory(category) {
      window.SLOS.withdrawConsent(category);
      // Reload page or update UI
      location.reload();
      }
      `

      Step 2: Withdrawal Confirmation

      `javascript
      // Withdrawal confirmation modal
      function showWithdrawalConfirm(category) {
      const confirmed = confirm(Are you sure you want to withdraw consent for ${category}? This may affect website functionality.);
      if (confirmed) {
      window.SLOS.withdrawConsent(category);
      // Clear related cookies
      clearCategoryCookies(category);
      }
      }
      `

      Configure Advanced Cookie Policies

      Step 1: Cookie Expiry Management

      `javascript
      const cookiePolicies = {
      ‘essential’: {
      ‘expiry’: ‘1 year’,
      ‘secure’: true,
      ‘httpOnly’: true
      },
      ‘analytics’: {
      ‘expiry’: ‘2 years’,
      ‘secure’: true,
      ‘sameSite’: ‘Lax’
      },
      ‘marketing’: {
      ‘expiry’: ‘1 year’,
      ‘secure’: true,
      ‘sameSite’: ‘None’
      }
      };
      `

      Step 2: Cross-Domain Consent

      Handle consent across subdomains and related domains:

      `javascript
      // Set consent cookie for all subdomains
      function setCrossDomainConsent(category, consented) {
      const domains = [‘.example.com’, ‘.blog.example.com’, ‘.shop.example.com’];

      domains.forEach(domain => {
      document.cookie = slos_${category}=${consented}; domain=${domain}; path=/; max-age=31536000; secure; samesite=lax;
      });
      }
      `

      Implement Consent Auditing

      Step 1: Consent Log Configuration

      `
      SLOS → Consent Management → Audit Settings
      `

      Audit Data Collection:
      `javascript
      // Log consent changes
      function logConsentChange(category, action, source) {
      const logEntry = {
      timestamp: new Date().toISOString(),
      category: category,
      action: action, // ‘granted’, ‘withdrawn’, ‘updated’
      source: source, // ‘banner’, ‘portal’, ‘api’
      user_id: getUserId(),
      ip_address: getClientIP(),
      user_agent: navigator.userAgent
      };

      // Send to audit endpoint
      fetch(‘/wp-json/slos/v1/audit/consent’, {
      method: ‘POST’,
      headers: { ‘Content-Type’: ‘application/json’ },
      body: JSON.stringify(logEntry)
      });
      }
      `

      Step 2: Consent History Tracking

      Store complete consent history for compliance:

      `php
      // Consent history storage
      function storeconsenthistory($userid, $consentdata) {
      global $wpdb;

      $wpdb->insert(
      $wpdb->prefix . ‘slosconsenthistory’,
      array(
      ‘userid’ => $userid,
      ‘consentdata’ => jsonencode($consent_data),
      ‘timestamp’ => current_time(‘mysql’),
      ‘ipaddress’ => $SERVER[‘REMOTE_ADDR’],
      ‘useragent’ => $SERVER[‘HTTPUSERAGENT’]
      )
      );
      }
      `

      Set Up Consent Validation

      Step 1: Consent Proof Requirements

      Configure requirements for valid consent:

      GDPR Compliance:

    27. Consent must be freely given
    28. Consent must be specific
    29. Consent must be informed
    30. Consent must be unambiguous
    31. Consent must be withdrawable
    32. Validation Rules:
      `javascript
      function validateConsent(consentData) {
      const required = [‘timestamp’, ‘categories’, ‘source’, ‘version’];

      for (const field of required) {
      if (!consentData[field]) {
      return { valid: false, error: Missing required field: ${field} };
      }
      }

      // Check consent age (must be recent)
      const consentAge = Date.now() – new Date(consentData.timestamp).getTime();
      if (consentAge > 365 24 60 60 1000) { // 1 year
      return { valid: false, error: ‘Consent is too old’ };
      }

      return { valid: true };
      }
      `

      Step 2: Consent Versioning

      Track consent policy versions:

      `json
      {
      “consent_version”: “2.1”,
      “policy_version”: “2024.01”,
      “changes”: [
      “Added social media category”,
      “Updated retention periods”,
      “Enhanced withdrawal process”
      ],
      “effective_date”: “2024-01-15”
      }
      `

      Test Custom Categories

      Step 1: Category Testing Checklist

      Functionality Testing:

    33. [ ] Categories appear in banner correctly
    34. [ ] Consent choices save properly
    35. [ ] Cookies load/unload based on consent
    36. [ ] Withdrawal works for each category
    37. [ ] Cross-domain consent syncs
    38. Compliance Testing:

    39. [ ] Legal basis properly documented
    40. [ ] Cookie table accurate and complete
    41. [ ] Vendor information correct
    42. [ ] Audit logs capture all changes
    43. [ ] Consent validation passes
    44. User Experience Testing:

    45. [ ] Banner loads quickly with custom categories
    46. [ ] Category descriptions clear and helpful
    47. [ ] Mobile experience optimized
    48. [ ] Accessibility features work
    49. [ ] Multi-language support functions
    50. Step 2: Performance Testing

    51. Test page load times with different consent combinations
    52. Verify cookie blocking doesn’t break functionality
    53. Check memory usage with multiple categories
    54. Test concurrent consent changes
    55. Monitor Category Performance

      Step 1: Consent Analytics

      Track category-specific metrics:

      Acceptance Rates:
      `javascript
      // Track category acceptance
      function trackCategoryAcceptance(category) {
      gtag(‘event’, ‘consent_update’, {
      ‘category’: category,
      ‘action’: ‘accepted’,
      ‘timestamp’: new Date().toISOString()
      });
      }
      `

      Usage Patterns:

    56. Most/least accepted categories
    57. Consent changes over time
    58. Withdrawal rates by category
    59. Geographic variations
    60. Step 2: Optimization Opportunities

    61. Identify underperforming categories
    62. A/B test category descriptions
    63. Optimize banner placement
    64. Improve consent flow
    65. Maintenance and Updates

      Step 1: Regular Category Review

    66. Review category usage quarterly
    67. Update cookie lists as vendors change
    68. Refresh legal basis documentation
    69. Audit consent logs for issues
    70. Step 2: Category Lifecycle Management

    71. Deprecate unused categories
    72. Archive old consent data
    73. Update vendor information
    74. Refresh cookie policies
    75. Troubleshooting Custom Categories

      Common Issues

      Categories Not Appearing:

    76. Check category configuration
    77. Verify banner template includes custom categories
    78. Test with different user roles
    79. Check for JavaScript errors
    80. Consent Not Saving:

    81. Verify database table structure
    82. Check AJAX endpoints
    83. Test cookie settings
    84. Review server logs
    85. Cookies Not Blocking:

    86. Check script loading conditions
    87. Verify category mapping
    88. Test with different browsers
    89. Review network requests
    90. Performance Issues:

    91. Optimize category loading
    92. Reduce cookie table size
    93. Cache consent decisions
    94. Minimize DOM manipulation
    95. Advanced Debugging

      `javascript
      // Debug consent state
      console.log(‘Current consent state:’, window.SLOS.getConsentState());

      // Debug category configuration
      console.log(‘Category config:’, window.SLOS.getCategoryConfig(‘custom_category’));

      // Debug cookie blocking
      console.log(‘Blocked scripts:’, window.SLOS.getBlockedScripts());
      `

      Support Resources

    96. Consent management best practices
    97. Cookie compliance guides
    98. Vendor management documentation
    99. Performance optimization tips

Share this article

Was this article helpful?

Help us improve our documentation

Still need help?

Our support team is ready to assist you with personalized guidance for your workspace.

Submit a support ticket