SDKs
Go SDK
Quick Start Guide for UserCanal Go SDK
Usercanal helps you track user behavior and business metrics across your applications. Our SDK provides built-in support for common analytics patterns while maintaining flexibility for custom use cases.
Quick Start (2 minutes)
1. Install the SDK
2. Initialize the Client
3. Track Your First Event
Core Events & Types
UserCanal provides standard event names and type-safe constants for common business metrics. See all types
Event Types – Key Revenue & Conversion Events
Event | Description |
---|---|
OrderCompleted | Purchase made |
SubscriptionStarted | New subscription |
SubscriptionChanged | Plan changed |
SubscriptionCanceled | Subscription ended |
CartViewed | Cart viewed |
CheckoutStarted | Checkout started |
CheckoutCompleted | Checkout completed |
Example: Track a subscription change
Example: Track signup
User Identification
Group/Organization Tracking
Configuration
Best Practices
- Use Standard Events
- Use provided constants for common events.
- This enables automatic analytics and dashboards.
- Event Properties
- Use consistent property names.
- Include all relevant context.
- Avoid sensitive data.
- Error Handling
- Check errors from all SDK methods.
- Use appropriate timeouts.
- Monitor retry counts.
Debugging & Monitoring
The SDK provides built-in debugging capabilities when debug mode is enabled:
Connection Monitoring
Batch Processing
- Events are automatically batched for efficiency
- Use
Flush()
to force-send pending events - Monitor queue size with
GetStats()
Complete E-commerce Example
Here's a complete example showing common e-commerce tracking patterns:
Need Help?
License
This SDK is distributed under the MIT License. See LICENSE for more information.