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.
Overview
Custom properties allow you to attach additional context to events. Properties are key-value pairs that provide details about user actions, product attributes, transaction values, or any other relevant data.Valid Property Types
Databuddy supports the following JavaScript/TypeScript types for event properties:Adding Properties to Events
Custom Events
Add properties as the second argument totrack():
Pageview Properties
Add properties toscreenView() calls:
Global Properties
Set properties that will be attached to all future events:Global properties are merged with event-specific properties. If a property key exists in both, the event-specific value takes precedence.
Automatic Properties
Databuddy automatically adds the following properties to all events:Base Context
Full URL including origin, pathname, search, and hash.
Document title from the
<title> element.Previous page URL or
"direct" if no referrer.Browser viewport dimensions (e.g.,
"1920x1080").User’s timezone (e.g.,
"America/New_York").Browser language (e.g.,
"en-US").UTM Parameters
Marketing parameters are automatically extracted from the URL:Campaign source (e.g.,
"google", "newsletter").Marketing medium (e.g.,
"cpc", "email").Campaign name (e.g.,
"spring_sale_2024").Paid search terms.
A/B test content identifier.
Identity Properties
Persistent anonymous user identifier.
Current session identifier.
Event timestamp in milliseconds.
Property Naming Conventions
Recommended Format
Use camelCase for property keys to maintain consistency with JavaScript conventions:Reserved Prefixes
Avoid using these prefixes for custom properties:__(double underscore) - Reserved for internal propertiesutm_- Reserved for UTM parametersdid_- Reserved for Databuddy internal use
Descriptive Names
Choose property names that are self-explanatory:Common Property Patterns
E-commerce Properties
User Properties
Content Properties
Feature Usage Properties
Error Tracking
Databuddy provides a convenience function for tracking errors with structured properties:Error Property Types
The
trackError() function is a wrapper around track('error', ...) that provides better TypeScript types for error-specific properties.Dynamic Properties
Computed Values
Conditional Properties
Best Practices
Keep It Simple
Only include properties that provide actionable insights. Avoid tracking every possible data point.
Use Consistent Types
Keep property types consistent across events. Don’t use
orderId as a number in one event and a string in another.Avoid PII
Don’t track personally identifiable information (email, phone, address) in event properties unless necessary.
Document Your Events
Maintain a tracking plan that documents event names, properties, and their meanings for your team.
Property Limits
Related Documentation
- Custom Events - Track user actions
- User Identification - Anonymous and session IDs
- Sessions - Session management