Event Tracking Overview
MarkTag SDK provides three categories of events to comprehensively track user interactions and behaviors on your website or application. Each category serves a different purpose and requires different levels of implementation effort.
Event Categories
1. Automatic Events
What they are: Events that fire automatically when the MarkTag script is added to your site's header. No additional code or configuration is required.
Setup Required: None - they start firing immediately upon script installation.
Purpose: Capture fundamental user behaviors and interactions without any implementation effort.
Examples:
mouse_click- User clicksscroll_milestone- Scroll depth trackingrage_scroll- Frustration indicatorsmouse_movement- User engagement patternsproduct_zoom- Product image zooming
Platform Usage: Used for basic analytics and engagement tracking.
Learn more about Automatic Events →
2. Pre-defined Events
What they are: Custom events with suggested schemas that are optimized for the Markopolo platform's features. These require frontend implementation but follow standardized patterns.
Setup Required: Frontend code implementation following the suggested schemas.
Purpose: These events are special because Markopolo uses their payload for specific platform logic:
- ViewItem → Keeps products in knowledge base sync
- Purchase → Revenue attribution for campaign performance
- AddToCart → Enables cart abandonment campaigns
Categories:
- E-commerce: Purchase, AddToCart, BeginCheckout, ViewItem, ViewCart
- User Actions: Login, Signup, CompleteRegistration
- Engagement: Search, Share, Subscribe, StartTrial
- Lead Generation: Lead, SubmitApplication, Contact, Schedule
Platform Usage: Directly integrated with Markopolo's marketing features for campaign optimization, audience building, and attribution.
When to use: Implement these events to unlock the full potential of Markopolo's advertising and analytics features.
3. Custom Events
What they are: Events you define with any payload structure based on your specific business needs. Complete flexibility in naming and data.
Setup Required: Frontend code implementation with your custom schema.
Purpose: Track behaviors and metrics specific to your business that aren't covered by automatic or pre-defined events. These events:
- Appear in your analytics dashboard
- Can be used for custom reporting
- Are NOT used by Markopolo for platform-specific features
Examples:
recipe_savedfor a cooking appworkout_completedfor a fitness appdocument_exportedfor a SaaS toollevel_unlockedfor a gaming platformfeature_toggledfor feature usage tracking
Platform Usage: Analytics and reporting only - not integrated with marketing features.
When to use: When you need to track unique interactions for analytics that don't fit pre-defined event schemas.
How to implement Custom Events →
Event Categories Comparison
| Event Type | Setup Required | Used by Platform Features | Flexibility |
|---|---|---|---|
| Automatic | None - fires immediately | Basic analytics | None - predefined |
| Pre-defined | Frontend implementation | Yes - marketing features, product sync, optimization | Schema suggested but extensible |
| Custom | Frontend implementation | No - analytics only | Complete - any name, any payload |
Quick Implementation Guide
Basic Event Logging
// Pre-defined Event Example (Platform-optimized)
mtag("event", {
type: "Purchase",
email: "customer@example.com",
value: 99.99,
currency: "USD",
products: [
{
id: "SKU-123",
name: "Product Name",
price: 99.99,
quantity: 1,
},
],
});
// Custom Event Example (Analytics only)
mtag("event", {
type: "recipe_favorited",
recipe_id: "RCP-456",
recipe_name: "Chocolate Cake",
category: "Desserts",
});Best Practices
Start with Automatic Events - They're already tracking, so review what data you're getting for free
Implement Key Pre-defined Events - Focus on events that match your core business activities:
- E-commerce sites: Purchase, AddToCart, ViewItem (for product sync)
- SaaS platforms: Signup, StartTrial, Subscribe
- Content sites: ViewContent, Share, Search
- Lead Gen: Lead, Contact, SubmitApplication
Understand Platform Integration - Pre-defined events unlock specific features:
- ViewItem → Product catalog synchronization
- Purchase → Revenue attribution for campaigns
- AddToCart → Cart abandonment campaigns
Add Custom Events for Analytics - Create custom events for metrics not covered by pre-defined events
Include User Identifiers - Always include email or phone when available for better user tracking
Event Data Flow
Important Note for Partners API Users
TIP
If you're using Markopolo only through the Partners API for analytics (not using the full marketing platform), pre-defined events may not be as relevant since you won't be using marketing features like campaign optimization or product sync. You can use custom events with any schema for your analytics needs.
Next Steps
- Review Automatic Events to understand what's tracked by default
- Browse Pre-defined Events to find platform-optimized events
- Learn about Custom Events for unique tracking needs
- View Installation Guide if you haven't set up MarkTag yet