Event Tracking Setup
analyze.swiss supports both automatic and custom event tracking.
Auto-Capture Events
Section titled “Auto-Capture Events”With auto-capture enabled, these events are tracked automatically:
| Event | Description |
|---|---|
| Pageviews | Every page navigation |
| Clicks | Button and link clicks |
| Form Submissions | Form submit events |
| Scroll Depth | 25%, 50%, 75%, 100% |
| Engagement | Time spent on page |
Enable Auto-Capture
Section titled “Enable Auto-Capture”```html
```
Custom Events
Section titled “Custom Events”Track specific actions important to your business:
```javascript // Track a signup analyze.track(‘signup’, { plan: ‘pro’, source: ‘landing_page’ });
// Track a feature usage analyze.track(‘feature_used’, { feature: ‘export_csv’ }); ```
Event Properties
Section titled “Event Properties”Add context to your events:
```javascript analyze.track(‘purchase’, { order_id: ‘12345’, revenue: 99.00, currency: ‘USD’, products: [‘SKU-1’, ‘SKU-2’] }); ```
Best Practices
Section titled “Best Practices”- Use consistent naming (snake_case recommended)
- Include relevant properties
- Don’t track sensitive data (passwords, PII)
- Test events before deploying