Skip to content

Commit c74abe8

Browse files
HyteqHyteq
authored andcommitted
fix: missing websites types for validation
2 parents 9d8bc2c + 22f2d2c commit c74abe8

9 files changed

Lines changed: 931 additions & 143 deletions

File tree

apps/docs/content/docs/Integrations/nextjs.mdx

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function RootLayout({
3838
<html lang="en">
3939
<body>
4040
<Databuddy
41-
clientId={process.env.NEXT_PUBLIC_DATABUDDY_SITE_ID!}
41+
clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID!}
4242
trackScreenViews={true}
4343
trackHashChanges={true}
4444
trackAttributes={true}
@@ -95,7 +95,7 @@ export default function RootLayout({
9595
<html lang="en">
9696
<body>
9797
<Databuddy
98-
clientId={process.env.NEXT_PUBLIC_DATABUDDY_SITE_ID!}
98+
clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID!}
9999
trackScreenViews={true}
100100
/>
101101
{children}
@@ -138,7 +138,7 @@ function MyApp({ Component, pageProps }: AppProps) {
138138
return (
139139
<>
140140
<Databuddy
141-
clientId={process.env.NEXT_PUBLIC_DATABUDDY_SITE_ID!}
141+
clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID!}
142142
trackScreenViews={true}
143143
trackAttributes={true}
144144
/>
@@ -164,9 +164,9 @@ export default function Document() {
164164
<Head>
165165
<script
166166
src="https://app.databuddy.cc/databuddy.js"
167-
data-client-id={process.env.NEXT_PUBLIC_DATABUDDY_SITE_ID}
167+
data-client-id={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID}
168168
data-track-screen-views="true"
169-
async
169+
defer
170170
/>
171171
</Head>
172172
<body>
@@ -183,13 +183,13 @@ export default function Document() {
183183
Add to your `.env.local`:
184184

185185
```tsx
186-
NEXT_PUBLIC_DATABUDDY_SITE_ID=your_site_id_here
186+
NEXT_PUBLIC_DATABUDDY_CLIENT_ID=your_client_id_here
187187
```
188188

189189
For production, add to your deployment environment:
190190

191191
```tsx
192-
NEXT_PUBLIC_DATABUDDY_SITE_ID=your_production_site_id
192+
NEXT_PUBLIC_DATABUDDY_CLIENT_ID=your_production_client_id
193193
```
194194

195195
## Tracking Events
@@ -292,7 +292,7 @@ export default function RootLayout({
292292
<html lang="en">
293293
<body>
294294
<Databuddy
295-
clientId={process.env.NEXT_PUBLIC_DATABUDDY_SITE_ID!}
295+
clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID!}
296296
// Core tracking
297297
trackScreenViews={true}
298298
trackHashChanges={true}
@@ -340,7 +340,7 @@ export default function RootLayout({
340340
<body>
341341
{process.env.NODE_ENV === 'production' && (
342342
<Databuddy
343-
clientId={process.env.NEXT_PUBLIC_DATABUDDY_SITE_ID!}
343+
clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID!}
344344
trackScreenViews={true}
345345
trackAttributes={true}
346346
/>
@@ -369,28 +369,17 @@ import { Databuddy } from '@databuddy/sdk';
369369
### Environment Variables on Vercel
370370

371371
1. Go to your Vercel project settings
372-
2. Add environment variable: `NEXT_PUBLIC_DATABUDDY_SITE_ID`
372+
2. Add environment variable: `NEXT_PUBLIC_DATABUDDY_CLIENT_ID`
373373
3. Set different values for preview and production environments
374374

375375
## Troubleshooting
376376

377377
### Common Issues
378378

379-
**Script Not Loading**: Ensure your environment variable `NEXT_PUBLIC_DATABUDDY_SITE_ID` is set correctly.
379+
**Script Not Loading**: Ensure your environment variable `NEXT_PUBLIC_DATABUDDY_CLIENT_ID` is set correctly.
380380

381381
**Events Not Tracking**: Check browser console for any JavaScript errors and verify the Databuddy script is loaded.
382382

383383
**Route Tracking**: If using custom route tracking, make sure the Analytics component is properly added to your layout.
384384

385-
### Debug Mode
386-
387-
Enable debug mode in development:
388-
389-
```tsx
390-
<Databuddy
391-
clientId={process.env.NEXT_PUBLIC_DATABUDDY_SITE_ID!}
392-
debug={process.env.NODE_ENV === 'development'}
393-
/>
394-
```
395-
396-
Need help with your Next.js integration? Contact us at [help@databuddy.cc](mailto:help@databuddy.cc).
385+
Need help with your Next.js integration? Contact us at [help@databuddy.cc](mailto:help@databuddy.cc).

apps/docs/content/docs/dashboard.mdx

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ Discover your global audience and optimize for different regions:
272272
**Privacy Note**: Location data is derived from IP addresses and anonymized. No precise location tracking is performed.
273273
</Callout>
274274

275+
<Callout type="tip" title="Powering the Map View">
276+
The geographic data displayed on maps and in regional breakdowns is typically derived from the user's IP address at the beginning of a session. This functionality is an integral part of session tracking. Ensure `trackSessions={true}` (which is enabled by default) in your [SDK configuration](/docs/sdk#-configuration-options) to collect this data.
277+
</Callout>
278+
275279
## 💻 Technology Stack Analysis
276280

277281
Understand your audience's technical environment:
@@ -323,6 +327,10 @@ Understand your audience's technical environment:
323327

324328
Track and analyze your business-specific events with detailed property breakdowns:
325329

330+
<Callout type="info" title="Populating This Section">
331+
The analytics, breakdowns, and examples shown here are populated by the custom events you actively send from your application using the `db.track('your_event_name', {your_properties})` method. The more relevant and well-structured custom events you track, the more insightful this section will become. For detailed guidance on how to implement custom event tracking, please refer to the [SDK Methods Reference](/docs/sdk#-sdk-methods-reference) and strategies in the [Custom Event Tracking](/docs/sdk#-custom-event-tracking) section of the SDK documentation.
332+
</Callout>
333+
326334
### 📊 Enhanced Event Interface
327335

328336
<Tabs items={['Hierarchical View', 'Property Breakdowns', 'Interactive Features']}>
@@ -500,6 +508,10 @@ Slice and dice your data for specific insights:
500508

501509
Monitor your website's technical health and user experience:
502510

511+
<Callout type="tip" title="Enabling Performance Data">
512+
The performance metrics, including Core Web Vitals, are populated when you enable `trackPerformance={true}` (enabled by default) and `trackWebVitals={true}` (disabled by default, but recommended) in your [SDK configuration](/docs/sdk#-optional-tracking-features). Enabling these options allows the SDK to collect detailed timing and performance data from the user's browser.
513+
</Callout>
514+
503515
### ⚡ Core Web Vitals
504516

505517
<Tabs items={['Understanding Metrics', 'Performance Optimization']}>
@@ -575,6 +587,10 @@ Monitor your website's technical health and user experience:
575587

576588
Monitor and resolve issues affecting your users:
577589

590+
<Callout type="tip" title="Enabling Error Data Collection">
591+
To populate the error tracking sections of the dashboard, ensure you have `trackErrors={true}` enabled in your [SDK configuration](/docs/sdk#-optional-tracking-features). This will automatically capture unhandled JavaScript errors and promise rejections. For more detailed context on specific handled errors, you can manually send error events using `db.track('error', { /* custom properties */ })` as described in the [SDK Methods Reference](/docs/sdk#-sdk-methods-reference).
592+
</Callout>
593+
578594
### 🐛 JavaScript Error Analytics
579595

580596
<Accordions>
@@ -759,4 +775,54 @@ Get your data where you need it:
759775

760776
<Callout type="info">
761777
**Need Help?** Join our [Discord community](https://discord.gg/JTk7a38tCZ) or [contact support](mailto:support@databuddy.cc) for dashboard assistance.
762-
</Callout>
778+
</Callout>
779+
780+
---
781+
782+
## 📊 Funnel Analysis
783+
784+
Funnel analysis helps you understand how users progress through specific sequences of actions on your site, such as a signup process or a checkout flow. Defining and tracking these steps is crucial for identifying drop-off points and optimizing conversion rates.
785+
786+
<Callout type="tip" title="Populating Funnel Data">
787+
To populate funnel data, you need to:
788+
1. Define the steps of your funnel within the Databuddy dashboard settings.
789+
2. Ensure each step corresponds to a custom event (or page view) that you are tracking with the SDK. For example, a signup funnel might be defined by a sequence of events like `viewed_signup_page` (a screen view), `started_signup_form` (custom event), and `completed_signup` (custom event).
790+
791+
The sequence of these events for users will then build the funnel visualization. For more details on sending custom events, see the [SDK Methods Reference](/docs/sdk#-sdk-methods-reference) in the SDK documentation.
792+
</Callout>
793+
794+
*(Detailed instructions on how to define funnels within the dashboard interface and interpret the funnel visualization will be available here. This feature helps pinpoint where users drop off in key workflows.)*
795+
796+
---
797+
798+
## 🗺️ User Journey Visualization
799+
800+
User journey visualization allows you to see the paths users take through your website on a session-by-session basis. This includes the sequence of page views and custom events they trigger, offering insights into user behavior and navigation patterns.
801+
802+
<Callout type="tip" title="Data for User Journeys">
803+
This feature relies on the comprehensive event data tracked by the SDK. The richness of the user journeys depends on:
804+
- Thorough `screen_view` tracking (often automatic via `trackScreenViews={true}` in the [SDK configuration](/docs/sdk#-configuration-options)).
805+
- Detailed custom event tracking (`db.track()`) for significant interactions as described in the [SDK Methods Reference](/docs/sdk#-sdk-methods-reference).
806+
807+
Each event is tied to a user's session, allowing the dashboard to reconstruct their path.
808+
</Callout>
809+
810+
*(Information on how to access and interpret user journey maps in the dashboard, including filtering by user segments or starting/ending events, will be detailed here. This helps understand common paths to conversion or points of confusion.)*
811+
812+
---
813+
814+
## 👤 User Profiles
815+
816+
The dashboard can compile user profiles that show a history of activity for individual visitors, even if they are anonymous. These profiles are built by aggregating all events linked to the same unique user ID, which the SDK manages automatically as part of session tracking (`trackSessions={true}`).
817+
818+
<Callout type="tip" title="Building Rich User Profiles">
819+
Richer user profiles are developed when you consistently track custom events that provide context about user actions and milestones. While the SDK handles user identification, the depth of each profile is determined by the quality and breadth of your event tracking strategy.
820+
821+
Refer to these SDK documentation sections for more:
822+
- [Custom Event Tracking](/docs/sdk#-custom-event-tracking) for strategy.
823+
- [Standard Event Reference](/docs/sdk#-standard-event-reference) for common event types.
824+
- [SDK Methods Reference](/docs/sdk#-sdk-methods-reference) for `db.track()` and `db.setGlobalProperties()`.
825+
- The `db.setGlobalProperties()` method can be particularly useful for adding persistent attributes to a user's profile.
826+
</Callout>
827+
828+
*(Details on where to find user profiles in the dashboard, what information they contain (e.g., event history, first seen, last seen, device info, location), and how to use them for segmentation or understanding individual user behavior will be provided here.)*

apps/docs/content/docs/getting-started.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ export default function RootLayout({ children }: { children: React.ReactNode })
9393
clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID!}
9494
trackScreenViews
9595
trackPerformance
96-
trackWebVitals
97-
trackErrors
96+
trackWebVitals={true} // Default is false, explicitly enable for quick start
97+
trackErrors={true} // Default is false, explicitly enable for quick start
9898
/>
9999
{children}
100100
</body>
@@ -359,14 +359,14 @@ window.pageLoadTime = Date.now();
359359
## 🎉 What's Next?
360360

361361
<Cards>
362-
<Card title="SDK Reference" href="/docs/sdk" icon="📦">
363-
Explore all configuration options and advanced features
362+
<Card title="SDK Configuration Guide" href="/docs/sdk#-configuration-options" icon="📦">
363+
Explore all SDK configuration props and options
364364
</Card>
365365
<Card title="Dashboard Guide" href="/docs/dashboard" icon="📊">
366-
Learn to navigate your analytics dashboard
366+
Learn to navigate your analytics dashboard and its features
367367
</Card>
368-
<Card title="SDK Reference" href="/docs/sdk" icon="⚙️">
369-
Set up custom events, performance monitoring, and more
368+
<Card title="Event Tracking Deep Dive" href="/docs/sdk#-sdk-methods-reference" icon="⚙️">
369+
Master custom event tracking, SDK methods, and standard event types
370370
</Card>
371371
<Card title="Security & Privacy" href="/docs/security" icon="🔒">
372372
Configure privacy settings and GDPR compliance

apps/docs/content/docs/performance/core-web-vitals-guide.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,4 @@ Ready to optimize your Core Web Vitals? Databuddy provides built-in performance
512512

513513
[Start monitoring your Core Web Vitals →](https://app.databuddy.cc/register)
514514

515-
---
516-
517-
*Last updated: June 2025*
515+
---

apps/docs/content/docs/privacy/cookieless-analytics-guide.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,4 @@ Ready to go cookieless? Databuddy makes the transition simple and seamless.
525525

526526
[Start your cookieless analytics journey →](https://app.databuddy.cc/register)
527527

528-
---
529-
530-
*Last updated: June 2025*
528+
---

0 commit comments

Comments
 (0)