Quickstart Guide
Get your analytics up and running in under 5 minutes. This guide will walk you through creating an account, installing the SDK, and seeing your first analytics data.This quickstart focuses on React/Next.js. For other frameworks, see the Installation guide.
Step 1: Create Your Account
Sign Up
Go to app.databuddy.cc and create a free account.
Step 2: Install the SDK
Install the@databuddy/sdk package in your project:
The SDK is lightweight (< 10KB gzipped) and has zero dependencies.
Step 3: Add Databuddy to Your App
Add the<Databuddy /> component to your root layout or _app.tsx file:
- Next.js App Router
- Next.js Pages Router
- React (Vite/CRA)
Add to your
app/layout.tsx:app/layout.tsx
Step 4: Start Your Development Server
Run your development server:- Page views
- Navigation between pages
- Web Vitals (FCP, LCP, CLS, INP, TTFB)
- JavaScript errors
- Session duration
- Bounce rate
Step 5: View Your Analytics
Go to Your Dashboard
Open app.databuddy.cc and select your project.
Step 6: Track Custom Events
Now that basic tracking is working, let’s track a custom event:components/SignupButton.tsx
data-track attributes:
components/SignupButton.tsx
With
trackAttributes enabled, any element with a data-track attribute will automatically send an event when clicked. The data-* attributes become event properties.Configuration Options
Here are the most commonly used configuration options:Advanced Usage
Set Global Properties
Attach properties to all future events (useful for user traits):Manual Page Views
Databuddy tracks page views automatically, but you can trigger them manually:Flush Events
Force send all queued events immediately (useful before navigation to external sites):Reset Session
Clear all tracking data (useful after logout):TypeScript Support
The SDK is fully typed with TypeScript. Use the global types:Troubleshooting
No data appearing in dashboard
No data appearing in dashboard
Check these common issues:This will log all events to the console.
- Verify your Client ID is correct
- Check browser console for errors
- Make sure you’re not blocking the script with ad blockers
- Verify
disabledprop is not set totrue - Wait 30-60 seconds for data to appear
Events not being tracked
Events not being tracked
For custom events:
- Make sure
window.databuddyis defined before calling.track() - Check that event properties don’t contain functions or circular references
- Verify events appear in browser console with
debug={true}
- Make sure
trackAttributes={true}is enabled - Verify element has
data-trackattribute - Check that element is clickable
Script not loading
Script not loading
Common causes:
- Ad blockers or privacy extensions blocking the script
- CSP (Content Security Policy) blocking external scripts
- Network issues or CDN unavailable
- Whitelist
cdn.databuddy.ccandbasket.databuddy.ccin your CSP - Check Network tab in browser dev tools
- Try disabling browser extensions temporarily
TypeScript errors
TypeScript errors
If you see TypeScript errors:
-
Make sure you’re importing from the correct path:
-
Check that
window.databuddyexists before using: -
Add type assertions if needed:
Next Steps
Now that you have Databuddy tracking your website, explore these advanced features:Installation Guide
Detailed setup for Vue, vanilla JS, and custom configurations.
Custom Events
Learn best practices for tracking custom events and user actions.
Privacy Controls
Configure privacy settings, opt-out mechanisms, and GDPR compliance.
API Reference
Explore the full SDK API and all available methods.