Cookie Configuration

The Axitech Widget provides comprehensive cookie management capabilities, allowing you to control how cookies are handled within the widget. This is especially important for compliance with privacy regulations like GDPR, CCPA, and others.

The cookie configuration object supports the following properties:

PropertyTypeDescription
enabledbooleanMaster switch for all third-party cookies (GA, Clarity, W3W). When false, no cookies will be set and no requests will be made to these services.
gaIdstringOverrides the default Google Analytics ID.
clarityIdstringOptional Microsoft Clarity tag ID.
oneTrustDomainIdstringOneTrust domain ID for cookie banner integration.

Implementation

Basic Usage

load('your-api-key', {
  clientId: 'your-client-id',
  contact: {
    phone: '0330 058 4077',
    email: 'claims@example.com',
  },
  cookie: {
    enabled: true, // Allow cookies
    oneTrustDomainId: 'your-domain-id', // OneTrust domain ID
  },
});

If your widget is embedded on a page that already has cookie consent management, you can inherit those settings:

load('your-api-key', {
  clientId: 'your-client-id',
  // ...other settings
  cookie: {
    enabled: true,
  },
});

Custom Analytics IDs

You can specify custom Google Analytics or Microsoft Clarity IDs:

load('your-api-key', {
  clientId: 'your-client-id',
  // ...other settings
  cookie: {
    enabled: true,
    gaId: 'UA-CUSTOM-ID', // Custom GA ID
    clarityId: 'YOUR-CLARITY-ID', // Custom Clarity ID
  },
});

The widget provides a function to update cookie consent settings from the parent application:

import { updateWidgetCookieConsent } from 'axitech-widget';

// Update analytics consent
updateWidgetCookieConsent({
  analytics: true, // Allow analytics cookies
});

// Update multiple consent categories
updateWidgetCookieConsent({
  analytics: true, // Allow analytics cookies
  marketing: false, // Disallow marketing cookies
  functional: true, // Allow functional cookies
});

This is useful when your main application has its own cookie consent management system, and you want to synchronize settings with the embedded widget.

Acceptance Criteria

The cookie configuration satisfies the following criteria:

  • When enabled is set to false, no third-party cookies are set, and no requests are made to GA/Clarity/W3W.