c15t
/
C15T Logo
Frameworks
Welcome to c15t Docs
Introduction to Consent Management (c15t)
AI Tools Integrations
OSS
Contributing to c15t.com
License
Building Privacy Tools in the Open
Legal
Cookie Policy
Privacy Policy
C15T Logo
HomeFrontendIntegrationsSelf HostChangelog
xbskydiscordgithub1.4k
c15t
/
C15T Logo
Frameworks
Welcome to c15t Docs
Introduction to Consent Management (c15t)
AI Tools Integrations
OSS
Contributing to c15t.com
License
Building Privacy Tools in the Open
Legal
Cookie Policy
Privacy Policy
home-2Docs
chevron-rightIntegrations
chevron-rightDatabuddy

Databuddy

Databuddy is a privacy-focused analytics platform that helps you understand user behavior and track events. It supports cookieless tracking and manages consent automatically through c15t's consent state synchronization.

The Databuddy script automatically respects consent preferences by toggling tracking on and off based on the user's consent state.

Script Implementation

Adding the Databuddy script to c15t

import { configureConsentManager } from 'c15t';
import { databuddy } from '@c15t/scripts/databuddy';

configureConsentManager({
  // ... 
  scripts: [
    databuddy({ 
      clientId: 'your-client-id',
      scriptUrl: 'https://cdn.databuddy.cc/databuddy.js',
      apiUrl: 'https://basket.databuddy.cc',
      options: {
        trackScreenViews: true,
        trackOutgoingLinks: true,
      }
    }),
  ],
});

Using Databuddy in your application

Once initialized, Databuddy is available globally via window.databuddy or window.db:

// Track a custom event
window.databuddy?.trackCustomEvent('button_clicked', {
  button_id: 'signup',
  page: '/landing'
});

// Or use the shorthand
window.db?.track('purchase_completed', {
  amount: 99.99,
  currency: 'USD'
});

// Track a screen view manually
window.databuddy?.screenView('/dashboard', {
  user_role: 'admin'
});

// Set global properties for all events
window.databuddy?.setGlobalProperties({
  app_version: '1.2.3',
  environment: 'production'
});

How Consent Management Works

The Databuddy integration automatically handles consent management:

  1. Before Script Load: Sets window.databuddyConfig.disabled based on initial consent state
  2. On Consent Grant: Enables tracking by setting window.databuddy.options.disabled = false
  3. On Consent Revoke: Disables tracking by setting window.databuddy.options.disabled = true

This ensures that no tracking occurs without user consent, keeping your analytics privacy-compliant.

Configuration Options

The options parameter allows you to customize Databuddy's behavior:

databuddy({
  clientId: 'your-client-id',
  scriptUrl: 'https://cdn.databuddy.cc/databuddy.js',
  apiUrl: 'https://basket.databuddy.cc', // Optional, defaults to basket.databuddy.cc, change if self-hosting
  options: {
    // Tracking options
    trackScreenViews: true,        // Automatically track page views
    trackOutgoingLinks: true,      // Track clicks on external links
    trackAttributes: false,        // Track data-track attributes on elements
    trackErrors: false,            // Track JavaScript errors
    trackPerformance: true,        // Track performance metrics
    trackWebVitals: false,         // Track Core Web Vitals
  
    
    // Network options
    enableBatching: false,         // Batch events before sending
    batchSize: 10,                 // Events per batch
    batchTimeout: 2000,            // Batch timeout in ms
    samplingRate: 1.0,             // Sample rate (0.0-1.0)
  }
})

Types

DatabuddyConsentOptions

Property
Types

Script

Property
Types
C15T Logo
Leverage native React components for seamless integration and high performance in a robust Consent Management solution that empowers your development team while prioritizing privacy and compliance.
Product
  • Documentation
  • Components
Company
  • GitHub
  • Contact
Legal
  • Privacy Policy
  • Cookie Policy
c15t