Pre-defined Events
Pre-defined events integrate with Markopolo platform features like product catalog sync, revenue attribution, and abandoned cart campaigns.
Event Names (PascalCase)
All event type values must be PascalCase:
| Event | Platform Feature |
|---|---|
ViewContent | Audience segmentation |
ViewItem | Product catalog sync |
Login | Engagement tracking |
SignUp | New user tracking |
CompleteRegistration | Onboarding completion |
StartTrial | Trial conversions |
AddPaymentInfo | Checkout funnel |
AddShippingInfo | Checkout funnel |
ViewCart | Cart tracking |
AddToCart | Cart abandonment campaigns |
AddToWishlist | Wishlist tracking |
RemoveFromCart | Cart tracking |
BeginCheckout | Checkout funnel |
Purchase | Revenue attribution |
Refund | Refund tracking |
Search | Search analytics |
Share | Share tracking |
Subscribe | Subscription tracking |
Lead | Lead optimization |
SubmitApplication | Application tracking |
Contact | Contact form tracking |
Donate | Donation tracking |
Schedule | Appointment tracking |
Fcm | Push notifications |
Product Object
Used in events that accept a products array:
| Key | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Unique product ID |
name | string | ❌ | Product name |
category | string | ❌ | eg. "Apparel, Men's Clothing" |
quantity | number | ❌ | Quantity |
price | number | ❌ | Original price |
discounted | number | ❌ | Final price after discount |
discount | number | ❌ | ⚠️ Deprecated — use discounted |
description | string | ❌ | Product description |
coupon | string | ❌ | Coupon code |
image_url | string | ❌ | Product image URL |
url | string | ❌ | Product page URL |
variants | array | ❌ | Array of { attributes, price: { original, discounted?, currency }, isAvailable } |
ViewContent
js
mtag("event", {
type: "ViewContent",
email: "john@example.com", // Optional
phone: "+13425784032", // Optional
});ViewItem
js
mtag("event", {
type: "ViewItem",
email: "john@example.com",
phone: "+13425784032",
value: 40.0,
currency: "USD",
products: [
{
id: "SKU-345",
name: "Formal Shirt",
category: "Apparel, Men's Clothing",
quantity: 2,
price: 10.0,
discounted: 8.0,
},
],
});Login
js
mtag("event", {
type: "Login",
email: "john@example.com",
phone: "+13425784032",
});SignUp
js
mtag("event", {
type: "SignUp",
email: "john@example.com",
phone: "+13425784032",
});CompleteRegistration
js
mtag("event", {
type: "CompleteRegistration",
email: "john@example.com",
phone: "+13425784032",
});StartTrial
js
mtag("event", {
type: "StartTrial",
email: "john@example.com",
phone: "+13425784032",
value: 40.0,
currency: "USD",
products: [{ id: "SKU-345", name: "Formal Shirt", price: 10.0 }],
});AddPaymentInfo
js
mtag("event", {
type: "AddPaymentInfo",
email: "john@example.com",
phone: "+13425784032",
payment_type: "Credit Card", // Optional
value: 40.0,
currency: "USD",
products: [{ id: "SKU-345", name: "Formal Shirt", price: 10.0 }],
});AddShippingInfo
js
mtag("event", {
type: "AddShippingInfo",
email: "john@example.com",
phone: "+13425784032",
shipping_tier: "GROUND", // Optional
value: 40.0,
currency: "USD",
products: [{ id: "SKU-345", name: "Formal Shirt", price: 10.0 }],
});ViewCart
js
mtag("event", {
type: "ViewCart",
email: "john@example.com",
phone: "+13425784032",
value: 40.0,
currency: "USD",
products: [{ id: "SKU-345", name: "Formal Shirt", price: 10.0 }],
cart_state: {
products: [{ id: "SKU-345", quantity: 2 }],
},
});AddToCart
js
mtag("event", {
type: "AddToCart",
email: "john@example.com",
phone: "+13425784032",
value: 40.0,
currency: "USD",
products: [{ id: "SKU-345", name: "Formal Shirt", price: 10.0 }],
cart_state: {
products: [
{ id: "SKU-345", quantity: 2 },
{ id: "SKU-346", quantity: 1 },
],
},
});AddToWishlist
js
mtag("event", {
type: "AddToWishlist",
email: "john@example.com",
phone: "+13425784032",
value: 40.0,
currency: "USD",
products: [{ id: "SKU-345", name: "Formal Shirt", price: 10.0 }],
});RemoveFromCart
js
mtag("event", {
type: "RemoveFromCart",
email: "john@example.com",
phone: "+13425784032",
value: 40.0,
currency: "USD",
products: [{ id: "SKU-345", name: "Formal Shirt", price: 10.0 }],
cart_state: {
products: [{ id: "SKU-346", quantity: 1 }],
},
});BeginCheckout
js
mtag("event", {
type: "BeginCheckout",
email: "john@example.com",
phone: "+13425784032",
value: 40.0,
currency: "USD",
shipping_cost: 5.0, // Optional
tax: 2.5, // Optional
products: [{ id: "SKU-345", name: "Formal Shirt", price: 10.0 }],
});Purchase
js
mtag("event", {
type: "Purchase",
email: "john@example.com",
phone: "+13425784032",
value: 40.0,
currency: "USD",
shipping_cost: 5.0, // Optional
tax: 2.5, // Optional
transaction_id: "TRS123", // Optional
products: [{ id: "SKU-345", name: "Formal Shirt", price: 10.0 }],
});Refund
js
mtag("event", {
type: "Refund",
email: "john@example.com",
phone: "+13425784032",
value: 40.0,
currency: "USD",
transaction_id: "TRS123", // Optional
products: [{ id: "SKU-345", name: "Formal Shirt", price: 10.0 }],
});Search
js
mtag("event", {
type: "Search",
email: "john@example.com",
phone: "+13425784032",
search_term: "Flowers",
});Share
js
mtag("event", {
type: "Share",
email: "john@example.com",
phone: "+13425784032",
item_id: "SKU-345", // Optional
share_method: "Facebook", // Optional
});Subscribe
js
mtag("event", {
type: "Subscribe",
email: "john@example.com",
phone: "+13425784032",
value: 10.0,
currency: "USD",
products: [{ id: "Plan-034", name: "Premium", price: 10.0 }],
});Lead
js
mtag("event", {
type: "Lead",
email: "john@example.com",
phone: "+13425784032",
value: 40.0, // Optional
currency: "USD", // Optional
});SubmitApplication
js
mtag("event", {
type: "SubmitApplication",
email: "john@example.com",
phone: "+13425784032",
application_id: "APP-123", // Optional
});Contact
js
mtag("event", {
type: "Contact",
email: "john@example.com",
phone: "+13425784032",
});Donate
js
mtag("event", {
type: "Donate",
email: "john@example.com",
phone: "+13425784032",
});Schedule
js
mtag("event", {
type: "Schedule",
email: "john@example.com",
phone: "+13425784032",
});Fcm
js
mtag("event", {
type: "Fcm",
fcm_token: "fGc8x9abc...:APA91bF...", // Required
email: "john@example.com", // Optional
phone: "+13425784032", // Optional
});Cart State Tracking
cart_state.products represents the full current cart at the time the event fires. Markopolo uses this for abandoned cart detection.
| Event | When to send cart_state |
|---|---|
AddToCart | After adding — include full updated cart |
RemoveFromCart | After removing — include remaining cart |
ViewCart | When user views cart — include full cart |
TIP
products= item(s) involved in this specific actioncart_state.products= ALL items currently in the cart