Documentation Index Fetch the complete documentation index at: https://mintlify.com/databuddy-analytics/Databuddy/llms.txt
Use this file to discover all available pages before exploring further.
Why migrate to Databuddy?
Databuddy offers a privacy-first alternative to Google Analytics with:
Full data ownership - Your analytics data stays in your control
GDPR compliant - No cookie banners required for basic tracking
Lightweight SDK - Minimal performance impact on your site
Real-time analytics - Instant insights without sampling
Custom events - Track exactly what matters to your business
Flexible integrations - Connect with Stripe, webhooks, and more
Migration checklist
Before you begin, ensure you have:
Access to your Google Analytics account
Admin access to your website
Your Databuddy client ID from the dashboard
Step-by-step migration
Install the Databuddy SDK
Remove Google Analytics and install Databuddy. For Next.js apps: npm install @databuddy/sdk
Add your client ID to .env.local: NEXT_PUBLIC_DATABUDDY_CLIENT_ID = your-client-id-here
Add the tracking component to your root layout: import { Databuddy } from '@databuddy/sdk/react' ;
export default function RootLayout ({ children }) {
return (
< html >
< body >
< Databuddy
trackWebVitals
trackErrors
trackScrollDepth
/>
{ children }
</ body >
</ html >
);
}
For other frameworks, see the installation guide .
Map Google Analytics events to Databuddy
Databuddy automatically tracks: Google Analytics Databuddy Equivalent Pageviews screen_view (automatic)Session duration Tracked automatically Bounce rate is_bounce propertyUser engagement time_on_page, scroll_depth
For custom events, replace gtag() calls: // Before (Google Analytics)
gtag ( 'event' , 'purchase' , {
transaction_id: '12345' ,
value: 29.99 ,
currency: 'USD'
});
// After (Databuddy)
import { track } from '@databuddy/sdk' ;
track ( 'purchase' , {
transaction_id: '12345' ,
value: 29.99 ,
currency: 'USD'
});
Configure advanced tracking features
Enable features that replace GA4 capabilities: < Databuddy
clientId = "your-client-id"
// Performance monitoring (replaces GA Core Web Vitals)
trackWebVitals
trackPerformance
// Engagement tracking
trackScrollDepth
trackInteractions
trackOutgoingLinks
// Error monitoring
trackErrors
// Custom filtering
filter = { ( event ) => {
// Skip admin pages (like GA filters)
return ! event . path ?. includes ( '/admin' );
} }
// Path masking (replace dynamic IDs)
maskPatterns = { [ '/users/*' , '/orders/*' ] }
/>
Set up revenue tracking
If you’re tracking ecommerce with Google Analytics, Databuddy integrates directly with payment providers: Stripe Integration: Databuddy automatically captures revenue events from Stripe webhooks. Configure your webhook in Settings → Revenue Tracking. Supported events:
Payment succeeded/failed
Subscription created/updated/canceled
Refunds processed
Manual tracking: import { track } from '@databuddy/sdk' ;
track ( 'purchase' , {
transaction_id: payment . id ,
amount: payment . amount ,
currency: payment . currency ,
product_name: 'Pro Plan'
});
See the webhooks guide for payment provider setup.
Test your implementation
Verify tracking is working:
Open your website in a new incognito window
Navigate to a few pages and trigger some events
Check the Databuddy dashboard (events appear in real-time)
Verify custom events are appearing with correct properties
Enable debug mode during testing: Check browser console for tracking logs.
Run both tools in parallel (optional)
You can run Databuddy alongside Google Analytics during a transition period: import { Databuddy } from '@databuddy/sdk/react' ;
import Script from 'next/script' ;
export default function RootLayout ({ children }) {
return (
< html >
< body >
{ /* Keep GA4 running */ }
< Script
src = "https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"
strategy = "afterInteractive"
/>
{ /* Add Databuddy */ }
< Databuddy />
{ children }
</ body >
</ html >
);
}
Compare data for 1-2 weeks before removing Google Analytics.
Remove Google Analytics
Once you’re confident in Databuddy:
Remove all gtag() and Google Analytics scripts
Delete GA environment variables
Remove GA cookie consent notices (Databuddy doesn’t require them)
Archive GA data if needed for historical reference
Your site will be lighter and faster without the GA script (≈45KB savings).
Feature comparison
Google Analytics: Delayed reporting with up to 24-48 hour latencyDatabuddy: All events appear instantly in the dashboard
Google Analytics: Samples data on high-traffic sites (GA4 standard tier)Databuddy: Never samples data - every event is counted
Google Analytics: Requires cookie consent in EU/GDPR regionsDatabuddy: Privacy-first design, no cookie banners needed for basic tracking
Google Analytics: Limited to 500 event names, complex setupDatabuddy: Unlimited custom events with simple track() API
Google Analytics: 30-minute session timeout (configurable)Databuddy: 30-minute session timeout with automatic renewal
Google Analytics: Requires manual event implementationDatabuddy: Direct Stripe/Paddle webhook integration + manual tracking
Common migration questions
Can I import historical Google Analytics data?
Databuddy focuses on forward-looking analytics. We recommend:
Keep GA active for historical reference
Export key reports from GA before switching
Start fresh with Databuddy for cleaner data architecture
Historical data import is not currently supported.
How do I track the same user across domains?
Use cross-domain tracking with URL parameters: import { getTrackingParams } from '@databuddy/sdk' ;
const trackingParams = getTrackingParams ();
const url = `https://other-domain.com? ${ trackingParams } ` ;
The tracking IDs (anonId and sessionId) will be preserved across domains.
Does Databuddy work with Google Tag Manager?
Not directly. Databuddy uses a lightweight SDK approach instead of a tag manager. Benefits:
Smaller bundle size
Type-safe event tracking
Better developer experience
You can remove GTM entirely when migrating to Databuddy.
What about GA4's machine learning features?
Databuddy focuses on accurate, real-time reporting rather than predictive analytics. We provide:
Raw, unsampled data
Custom SQL queries for analysis
API access for building your own ML models
Export capabilities for data science workflows
Next steps
Custom dashboards Create custom reports and visualizations
Webhooks Set up payment and event webhooks
API Reference Explore the full SDK capabilities
Troubleshooting Common issues and debugging tips