Vemetric provides powerful event tracking capabilities to help you understand user behavior and product usage. This guide covers best practices for tracking pageviews, custom events, and user identification.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vemetric/vemetric/llms.txt
Use this file to discover all available pages before exploring further.
Event Types
Vemetric supports several types of events:Pageviews
Automatically tracked page visits
Custom Events
User actions and interactions
Outbound Links
Clicks on external links
System Events
Internal events prefixed with
$$Pageview Tracking
Pageviews are automatically tracked when you install the Vemetric script or SDK.Automatic Tracking
- JavaScript
- React
System Pageview Event
Pageviews are tracked with the system event name$$pageView. You can see these in your analytics dashboard under “Page View” events.
Custom Event Tracking
Custom events let you track specific user actions and interactions.Basic Event Tracking
- JavaScript
- React
- Node.js
Events with Custom Data
Attach custom properties to track additional context:- JavaScript/React
- Node.js
User Identification
Identify users to track them across sessions and devices.Identifying Users
- JavaScript
- React
- Node.js
User Identity Parameters
Unique identifier for the user. This can be:
- User ID from your database
- Email address
- Username
- Any unique identifier
The identifier is used to merge anonymous and identified user sessions.
Human-readable name displayed in the Vemetric dashboard
URL to the user’s profile picture or avatar
Reset User Identity
Clear the user identity when they log out:- JavaScript/React
- Node.js
User Properties
Track custom user attributes and update them over time.Set Properties
Set or update user properties:Set Once
Set properties only if they don’t already exist:Unset Properties
Remove user properties:Combining Operations
You can combine set, setOnce, and unset in a single call:Outbound Link Tracking
Clicks on external links are automatically tracked as$$outboundLink events.
What’s Tracked
Vemetric automatically tracks:- Clicks on links to external domains
- The destination URL
- The page where the click occurred
What’s Not Tracked
Links to the same domain (including subdomains) are considered internal and not tracked as outbound links.Custom Outbound Tracking
You can manually track outbound link clicks:Event Naming Best Practices
Use PascalCase for event names
Use PascalCase for event names
Use clear, descriptive names in PascalCase:✅ Good:
ButtonClickedProductViewedSignupCompletedPaymentProcessed
button_clicked(snake_case)product-viewed(kebab-case)click(too generic)event1(not descriptive)
Be specific but concise
Be specific but concise
Use specific names that clearly describe the action:✅ Good:
CheckoutStartedVideoPlayedFilterApplied
Click(too generic)UserClickedTheBlueButtonInTheHeaderNavigationMenu(too verbose)
Use past tense for completed actions
Use past tense for completed actions
Name events for what happened:✅ Good:
SignupCompletedEmailSentPaymentProcessed
SignupComplete(adjective)SendingEmail(in progress)
Avoid system event prefixes
Avoid system event prefixes
Don’t use the
$$ prefix - it’s reserved for system events:✅ Good:CustomPageViewFormSubmitted
$$customEvent$$myEvent
Common Tracking Patterns
E-commerce
SaaS Application
Content Platform
Advanced Techniques
Contextual Event Data
Include context about where and how an event occurred:Event Sequences
Track related events with shared identifiers:Error Tracking
Track errors and failures:Privacy Considerations
Don’t Track PII
Avoid tracking personally identifiable information in event data: ❌ Bad:Mask Sensitive URLs
Use path masking to prevent tracking sensitive pages:Testing Events
Verify in Dashboard
- Open your Vemetric dashboard
- Navigate to the Events page
- Filter by event name to see your tracked events
- Verify event data and user properties are correct
Console Debugging
For development, you can log events before tracking:Next Steps
JavaScript SDK
Detailed JavaScript SDK reference
React SDK
React-specific tracking guide
Node.js SDK
Server-side event tracking
Configuration
Advanced configuration options