Pre-defined Events
Pre-defined events are custom events with suggested schemas that are optimized for the Markopolo platform's features. Unlike automatic events which fire automatically, these events require frontend implementation but provide powerful integration with Markopolo's marketing and analytics features.
Why Use Pre-defined Events?
Pre-defined events are special because:
- Platform Integration: Markopolo uses these events for specific platform features
- Optimized Schemas: Standardized data structures ensure accurate reporting
- Feature Enablement: Enable advanced features like:
- Product knowledge base synchronization (via ViewItem events)
- Conversion tracking and optimization (via Purchase events)
- Audience segmentation and remarketing
- Attribution modeling
For Partners API Users
If you're using Markopolo only through the Partners API for analytics (not the full marketing platform), pre-defined events are optional. You can use custom events with any schema for your analytics needs.
Implementation
All pre-defined events follow this pattern:
mtag("event", payload);The payload object contains the event type and parameters specific to each event.
Platform Feature Integration
Pre-defined events are more than just analytics - Markopolo uses their payload for specific platform features:
| Event | Platform Feature | Business Impact |
|---|---|---|
ViewItem | Product catalog sync | Keeps product data current |
Purchase | Revenue attribution | Campaign performance measurement |
AddToCart | Cart abandonment campaigns | Recovers lost sales |
Complete List of Pre-defined Events
ViewContent
Add this event code to each page of your site to track when a customer visits it. MarkTag automatically collects the page URL and page information
Note: We recommend launching the ViewContent event during script initialization as mentioned in the installation guide. This ensures page views are tracked immediately when your pages load.
**
Schema
payload: {
type: 'ViewContent',
email: `<STRING: USER EMAIL>` // Optional
phone: `<STRING: USER PHONE NUMBER>` // Optional
}Example
payload: {
type: 'ViewContent',
email: 'john@example.com',
phone: '+13425784032',
}Platform Usage: Enhanced audience segmentation and remarketing. Note that ViewContent is also tracked automatically, but implementing it as a pre-defined event with user identifiers enables better attribution.
View Item
Add this event code to an item on your site to track when a customer clicks it to view details or add it to the item's detail page. MarkTag automatically collects the page URL and page information.
Platform Feature: This event is crucial for keeping your product catalog synchronized in Markopolo's knowledge base.
**
Schema
paylaod: {
type: 'ViewItem',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
value: <NUMBER: VALUE OF THIS ITEM >, // Optional
currency: <STRING: CURRENCY OF THE VALUE>, // Optional
products: <Array of Product object>, // Optional
}Product Object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}Example
payload: {
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",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
{
id: 'SKU-346',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "L", color: "White" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's white formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
}Login
Add this event to track a customer login.
**
Schema
payload: {
type: 'Login',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
}Example
payload: {
type: 'Login',
email: 'john@example.com',
phone: '+13425784032',
}Signup
Add this event to track a new customer signup
**
Schema
payload: {
type: 'Signup',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
}Example
payload: {
type: 'Signup',
email: 'john@example.com',
phone: '+13425784032',
}Complete Registration
Add this event to track when a customer completes registration.
**
Schema
payload: {
type: 'CompleteRegistration',
email: '<USER EMAIL>', // Optional
phone: '<USER PHONE NUMBER>', // Optional
// You can add additional key-value pairs
}Example
paload: {
type: 'CompleteRegistration',
email: 'john@example.com',
phone: '+13425784032',
}Start Trial
Add this event to track when a customer starts a trial
**
Schema
payload:{
type: 'StartTrial',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
value: <NUMBER: VALUE OF THIS ITEM >,
currency: <STRING: CURRENCY OF THE VALUE>,
products: <Array of Product object>,
}Product object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}Example
payload: {
type: 'StartTrial',
email: 'john@example.com',
phone: '+13425784032',
value: 40.0,
currency: 'USD',
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
{
id: 'SKU-346',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "L", color: "White" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's white formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
}Add Payment Info
Add this event to track when a customer adds payment info.
**
Schema
payload: {
type: 'AddPaymentInfo',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
payment_type: <STRING: TYPE OF PAYMENT>, // Optional
value: <NUMBER: VALUE OF THIS ITEM>, // Optional
currency: <NUMBER:CURRENCY OF VALUE>, //Optional
products: <ARRAY of Product Object>, //Optional
}Product Object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}Example
payload:{
type: 'AddPaymentInfo',
email: 'john@example.com',
phone: "+13425784032",
payment_type: "Credit Card"
value: 40.00,
currency: "USD",
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
{
id: 'SKU-346',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "L", color: "White" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's white formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
}Add Shipping Info
Add this event to track when a customer adds shipping info
**
Schema
payload: {
type: 'AddShippingInfo',
email: '<STRING : USER EMAIL>', // Optional
phone: '<STRING: USER PHONE NUMBER>', // Optional
shipping_tier: 'STRING: <TYPE OF SHIPPING>', // Optional
value: <NUMBER: VALUE OF THIS ITEM>, // Optional
currency: <STRING: CURRENCY OF VALUE>, //Optional
products: <ARRAY of Product Object>, //Optional
}Product Object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}Example
payload: {
type: 'AddShippingInfo',
email: 'john@example.com',
phone: '+13425784032',
shipping_tier: 'GROUND',
value: 40.00,
currency: "USD",
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
{
id: 'SKU-346',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "L", color: "White" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's white formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
}View Cart
Add this event code to an item on your site to track when a customer views their cart.
**
Schema
payload:{
type: 'ViewCart',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
value: <NUMBER: VALUE OF THIS ITEM >,
currency: <STRING: CURRENCY OF THE VALUE>,
products: <Array of Product object>,
cart_state: { // Optional - enables abandoned cart detection
products: <Array of Product object>, // All items currently in the cart
},
}Product Object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}payload: {
type: 'ViewCart',
email: 'john@example.com',
phone: '+13425784032',
value: 40.0,
currency: 'USD',
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
{
id: 'SKU-346',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "L", color: "White" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's white formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
cart_state: {
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
quantity: 2,
price: 10.0,
discounted: 8.0,
},
{
id: 'SKU-346',
name: 'Formal Shirt',
quantity: 2,
price: 10.0,
discounted: 8.0,
},
],
},
}Add To cart
Add this event code to an item on your site to track when a customer adds it to their cart.
Platform Feature: Enables cart abandonment campaigns and remarketing.
**
Schema
payload: {
type: 'AddToCart',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
value: <NUMBER: VALUE OF THIS ITEM >,
currency: <STRING: CURRENCY OF THE VALUE>,
products: <Array of Product object>,
cart_state: { // Optional - enables abandoned cart detection
products: <Array of Product object>, // All items currently in the cart
},
}Product Object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}Examples
payload: {
type: 'AddToCart',
email: 'john@example.com',
phone: '+13425784032',
value: 40.0,
currency: 'USD',
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
cart_state: {
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
quantity: 2,
price: 10.0,
discounted: 8.0,
},
{
id: 'SKU-346',
name: 'Casual Pants',
quantity: 1,
price: 25.0,
},
],
},
}Add To Wishlist
Add this event code to an item on your site to track when a customer adds it to their wishlist.
**
Schema
payload:{
type: 'AddToWishlist',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
value: <NUMBER: VALUE OF THIS ITEM >,
currency: <STRING: CURRENCY OF THE VALUE>,
products: <Array of Product object>,
}Example
payload: {
type: 'AddToWishlist',
email: 'john@example.com',
phone: '+13425784032',
value: 40.0,
currency: 'USD',
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
{
id: 'SKU-346',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "L", color: "White" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's white formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
}Remove From Cart
Add this event code to items in the cart on your site to track when a customer removes them from their cart.
**
Schema
payload: {
type: 'RemoveFromCart',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
value: <NUMBER: VALUE OF THIS ITEM >,
currency: <STRING: CURRENCY OF THE VALUE>,
products: <Array of Product object>,
cart_state: { // Optional - enables abandoned cart detection
products: <Array of Product object>, // All items remaining in the cart
},
}Product Object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}Example
payload:{
type: 'RemoveFromCart',
email: 'john@example.com',
phone: '+13425784032',
value: 40.0,
currency: 'USD',
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
cart_state: {
products: [
{
id: 'SKU-346',
name: 'Casual Pants',
quantity: 1,
price: 25.0,
},
],
},
}Begin Checkout
Add this event to your site to track when a customer begins to checkout.
**
Schema
paylaod: {
type: 'BeginCheckout',
email: <STRING: USER EMAIL>, // Optional
phone: <STRING: USER PHONE NUMBER>, // Optional
value: <NUMBER: TOTAL MONETARY VALUE OF THIS TRANSACTION >,
currency: <STRING: 3 DIGIT CURRENCY CODE OF THE VALUE>,
products: <Array of Product object>,
shipping_cost: <NUMBER: SHIPPING COST>, // Optional
tax: <NUMBER: TAX AMOUNT> // Optional
}Product Object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}Example
payload: {
type: 'BeginCheckout',
email: 'john@example.com',
phone: '+13425784032',
value: 40.0,
currency: 'USD',
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
{
id: 'SKU-346',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "L", color: "White" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's white formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
}Purchase
Add this event to track when a customer makes a purchase.
Platform Feature: Used for campaign performance measurement through revenue attribution.
**
Schema
payload: {
type: 'Purchase',
email: <STRING: USER EMAIL> // Optional
phone: <STRING: USER PHONE NUMBER> // Optional
value: <NUMBER: TOTAL MONETARY VALUE OF THIS TRANSACTION >
currency: <STRING: 3 DIGIT CURRENCY CODE OF THE VALUE>
products: <Array of Product object>,
shipping_cost: <NUMBER: SHIPPING COST> // Optional
tax: <NUMBER: TAX AMOUNT> // Optional
transaction_id: <STRING: UNIQUE ID OF THIS TRANSACTION> // Optional
}Product Object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}Example
payload: {
type: 'Purchase',
email: 'john@example.com',
phone: '+13425784032',
value: 40.0,
currency: 'USD',
shipping_cost: 5.0,
tax: 2.5,
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
{
id: 'SKU-346',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "L", color: "White" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's white formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
}Refund
Add this event to track when a customer makes a refund.
**
Schema
payload:{
type: 'Refund',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
value: <NUMBER: VALUE OF THIS ITEM >,
currency: <STRING: CURRENCY OF THE VALUE>,
products: <Array of Product object>,
transaction_id:<STRING: UNIQUE ID OF THIS TRANSACTION> // Optional,
}Product Object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}Example
payload: {
type: 'Refund',
email: 'john@example.com',
phone: '+13425784032',
value: 40.0,
currency: 'USD',
transaction_id: 'TRS123',
products: [
{
id: 'SKU-345',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "XL", color: "Blue" },
price: { original: 10.0, discounted: 8.0, currency: "USD" },
isAvailable: true
},
{
attributes: { size: "M", color: "Blue" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's blue formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
{
id: 'SKU-346',
name: 'Formal Shirt',
category: "Apparel, Men's Clothing",
variants: [
{
attributes: { size: "L", color: "White" },
price: { original: 10.0, currency: "USD" },
isAvailable: true
}
],
description: "Men's white formal shirt",
quantity: 2,
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
}Search
Add this event to the search bar of your site to track when an user searches for term or product.
**
Schema
payload: {
type: 'Search',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
item_id: <STRING: ITEM ID OF THE SHARED ITEM> // Optional
search_term: <STRING: SEARCH TERM>, // Optional
}Example
payload: {
type: 'Search',
email: 'john@example.com',
phone: '+13425784032',
search_term: 'Flowers',
}Share
Add this event to share buttons on your site to track when an user share something from your site.
**
Schema
payload: {
type: 'Share',
email: <STRING: USER EMAIL> , // Optional
phone:<STRING: USER PHONE NUMBER>, // Optional
item_id: <STRING: ITEM ID OF THE SHARED ITEM> // Optional
share_method: <STRING: SHARE METHOD>, // Optional
}Example
payload: {
type: 'Share',
email: 'john@example.com',
phone: '+13425784032',
share_method: 'Facebook',
}Subscribe
Add this event to track when a customer subscribes to a plan.
Platform Feature: Tracks subscription events.
**
Schema
paylad:{
type: 'Subscribe',
email: <STRING: USER EMAIL>, // Optional
phone: <STRING: USER PHONE NUMBER>, // Optional
value: <NUMBER: TOTAL MONETARY VALUE OF THIS TRANSACTION >,
currency: <STRING: 3 DIGIT CURRENCY CODE OF THE VALUE>,
products: <Array of Product object>,
}Product Object
{
/** Required: Unique id of product */
id: string;
/** Optional: Product Name eg. "Shirt" */
name: string;
/** Optional: Product Category
* eg. "Apparel" or "Apparel, Men's Clothing" */
category: string;
/** Optional: Array of variant objects.
* The array itself is optional, but when provided, all fields within each variant are required (except price.discounted). */
variants: Array<{
attributes: Record<string, string>; // Required: key-value pairs eg. { size: "M", color: "red" }
price: {
original: number; // Required: original price eg. 100.0
discounted?: number; // Optional: discounted price
currency: string; // Required: currency code eg. "USD"
};
isAvailable: boolean; // Required: whether this variant is available
}>;
/** Optional: Quantity of this product added to cart or purchased eg. 5 */
quantity: number;
/** Optional: Original price of the product before any discount eg. 7.59 */
price: number;
/** Optional: Description of the Product */
description: string;
/** Optional: Any coupon used through checkout */
coupon: string;
/** @deprecated Will be deprecated soon. Use `discounted` instead.
* Optional: Any monetary discount added to the product
* eg. if 5 USD discount is added, discount value should be 5.00.
* If any percentage discount is added, you need to convert the percentage to monetary value*/
discount: number;
/** Optional: The discounted price of the product (final price after discount)
* eg. if original price is 10.00 and discount is 2.00, discounted should be 8.00 */
discounted: number;
/** Optional: URL of the product image */
image_url: string;
/** Optional: URL of the product page.
* If not provided, the current page URL from the browser will be used.
* Recommended to provide explicitly if your URL contains tracking parameters or query strings */
url: string;
}Example
payload: {
type: 'Subscribe',
email: 'john@example.com',
phone: '+13425784032',
value: 10.0,
currency: 'USD',
products: [
{
id: 'Plan-034',
name: 'Premium',
description: 'Unlimited Streaming',
price: 10.0,
coupon: 'HAPPY10',
discount: 2.0,
discounted: 8.0,
image_url: 'https://example.com/images/formal-shirt.jpg',
},
],
}Lead
Add this event to your lead form's CTA button to track information when an user submits a lead form.
**
Schema
**
paylaod: {
type: 'Lead',
email: <STRING: USER EMAIL>, // Optional
phone: <STRING: USER PHONE NUMBER>, // Optional
value: <NUMBER: TOTAL MONETARY VALUE OF THIS LEAD >, // Optional
currency: <STRING: 3 DIGIT CURRENCY CODE OF THE VALUE>, // Optional
}Example
payload: {
type: 'Lead',
email: 'john@example.com',
phone: '+13425784032',
value: 40.0,
currency: 'USD',
}Submit Application
Add this event to your application form's CTA button to track information when an user submits an application form.
**
Schema
payload: {
type: 'SubmitApplication',
email: <STRING: USER EMAIL>, // Optional
phone: <STRING: USER PHONE NUMBER>, // Optional
application_id: <STRING: UNIQUE ID OF THE APPLICATION>, // Optional
}Example
payload: {
type: 'SubmitApplication',
email: 'john@example.com',
phone: '+13425784032',
}Contact
Add this event to a contact form to track when a customer wants to contact your business.
**
Schema
payload: {
type: 'Contact',
email: <STRING: USER EMAIL>, // Optional
phone: <STRING: USER PHONE NUMBER>, // Optional
}Example
payload:{
type: 'Contact',
email: 'john@example.com',
phone: '+13425784032',
}Donate
Add this event to track when someone donates to your organization.
**
Schema
payload:{
type: 'Donate',
email: <STRING: USER EMAIL>, // Optional
phone: <STRING: USER PHONE NUMBER>, // Optional
}Example
payload: {
type: 'Donate',
email: 'john@example.com',
phone: '+13425784032',
}Schedule
Add this event to track when someone schedules a call or meeting with your business.
**
payload: {
type: 'Schedule',
email: <STRING: USER EMAIL>, // Optional
phone: <STRING: USER PHONE NUMBER>, // Optional
}Example
payload: {
type: 'Schedule',
email: 'john@example.com',
phone: '+13425784032',
}Fcm
Add this event to register a user's Firebase Cloud Messaging (FCM) device token so they can receive push notifications.
Platform Feature: Markopolo uses the fcm_token to deliver push notifications to all users who have a registered token.
**
Schema
payload: {
type: 'Fcm',
fcm_token: <STRING: USER'S FCM DEVICE TOKEN>, // Required
email: <STRING: USER EMAIL>, // Optional
phone: <STRING: USER PHONE NUMBER>, // Optional
}Example
payload: {
type: 'Fcm',
fcm_token: 'fGc8x9abc...:APA91bF...',
email: 'john@example.com',
phone: '+13425784032',
}Cart State Tracking
Cart-related events support an optional cart_state field. While the products array in each event represents the items involved in that specific action (e.g., the item just added), cart_state represents the full current state of the user's cart at the time the event fires.
Why send cart_state?
Markopolo uses cart_state.products to determine if a user has items in their cart. This powers abandoned cart detection and automated abandoned cart campaign triggers.
cart_state Object
cart_state: {
products: <Array of Product object>
}The products array inside cart_state uses the same Product object schema as the top-level products field in event payloads (see any event above for the full Product object definition).
Which events should include cart_state?
| Event | When to send cart_state |
|---|---|
AddToCart | After adding the item — include the full updated cart |
RemoveFromCart | After removing the item — include the remaining cart |
ViewCart | When the user views their cart — include the full cart |
TIP
products= the item(s) involved in this specific action (e.g., the single item just added to cart)cart_state.products= ALL items currently in the user's cart after this action
Implementation Priority by Business Type
E-commerce Sites
Must Have:
ViewItem- Syncs product catalogAddToCart- Enables cart abandonment campaignsPurchase- Revenue attribution for campaign performance
Should Have:
BeginCheckout- Tracks checkout funnelViewContent- Enhanced remarketingSearch- Understand user intent
SaaS Platforms
Must Have:
Signup- Track new usersStartTrial- Monitor trial conversionsSubscribe- Revenue tracking
Should Have:
CompleteRegistration- Onboarding completionLogin- Engagement tracking
Lead Generation
Must Have:
Lead- Lead quality optimizationContact- Contact form submissions
Should Have:
SubmitApplication- Application trackingSchedule- Appointment bookings
Next Steps
- Review Automatic Events to see what's tracked without setup
- Explore Custom Events for tracking unique business metrics
- Return to Overview for the complete event tracking guide