Skip to main content

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
A Databuddy account (sign up at databuddy.cc)
Your Databuddy client ID from the dashboard

Step-by-step migration

1

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:
app/layout.tsx
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.
2

Map Google Analytics events to Databuddy

Databuddy automatically tracks:
Google AnalyticsDatabuddy Equivalent
Pageviewsscreen_view (automatic)
Session durationTracked automatically
Bounce rateis_bounce property
User engagementtime_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'
});
3

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/*']}
/>
4

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.
5

Test your implementation

Verify tracking is working:
  1. Open your website in a new incognito window
  2. Navigate to a few pages and trigger some events
  3. Check the Databuddy dashboard (events appear in real-time)
  4. Verify custom events are appearing with correct properties
Enable debug mode during testing:
<Databuddy debug />
Check browser console for tracking logs.
6

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.
7

Remove Google Analytics

Once you’re confident in Databuddy:
  1. Remove all gtag() and Google Analytics scripts
  2. Delete GA environment variables
  3. Remove GA cookie consent notices (Databuddy doesn’t require them)
  4. 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

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.
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.
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.
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

Build docs developers (and LLMs) love