انتقل إلى المحتوى

Custom events examples for e-commerce

هذا المحتوى غير متوفر بلغتك بعد.

Suggested events for e-commerce, each with recommended attributes and code samples. To send an event from your app, see Send custom events from your app. To use these events in segments and journeys, see industry playbooks.

Product viewed

Anchor link to

Fire this event when a user opens a product page. Use it for browse abandonment campaigns and to segment users by the products and categories they view.

Recommended attributes:

  • product_id: String
  • product_category: String
  • price: decimal (price)
  • source: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Product viewed", {
"product_id": "string value",
"product_category": "string value",
"price": 49.99,
"source": "string value"
});
});

Product added to cart

Anchor link to

Fire this event once a user adds product to their cart to build Abandoned Cart campaigns, set user tags, or analyze the efficiency of your promotions.

Recommended attributes:

  • product_id: String
  • price: decimal (price)
  • source: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Product added to cart", {
"product_id": "string value",
"price": 49.99,
"source": "string value"
});
});

Checkout started

Anchor link to

Fire this event when a user starts checkout. A user who started checkout but didn’t place an order is the audience for a checkout reminder.

Recommended attributes:

  • cart_id: String
  • cart_total: decimal (price)
  • currency: String
  • items_count: Integer
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Checkout started", {
"cart_id": "string value",
"cart_total": 49.99,
"currency": "USD",
"items_count": 2
});
});

Order placed

Anchor link to

Fire this event when a user completes a purchase. Send it for every purchase as your main purchase event, together with Discounted purchase, Product category, or First purchase when they also apply.

Recommended attributes:

  • order_id: String
  • __amount: decimal (price)
  • __currency: String, a currency code such as USD
  • product_id: String
  • coupon_id: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Order placed", {
"order_id": "string value",
"__amount": 49.99,
"__currency": "USD",
"product_id": "string value",
"coupon_id": "string value"
});
});

With the __amount and __currency attributes, Pushwoosh starts tracking revenue for this event automatically the first time it arrives. See Conversion events.

Order refunded

Anchor link to

Fire this event when an order is refunded, fully or partially. Use it to exclude these users from post-purchase campaigns or to ask why they returned the order.

Recommended attributes:

  • order_id: String
  • refund_amount: decimal (price)
  • currency: String
  • reason: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Order refunded", {
"order_id": "string value",
"refund_amount": 49.99,
"currency": "USD",
"reason": "string value"
});
});

Discounted purchase

Anchor link to

Trigger this event once a user purchases any product using a discount coupon.

Recommended attributes:

  • product_id: String
  • coupon_id: String
  • price: decimal (price)
  • discount: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Discounted purchase", {
"product_id": "string value",
"coupon_id": "string value",
"price": 49.99,
"discount": "string value"
});
});

Product page abandoned

Anchor link to

Fire this event when a user leaves a product page without a conversion action.

Recommended attributes:

  • product_id: String
  • price: decimal (price)
  • source: String
  • product_page_id: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Product Page abandoned", {
"product_id": "string value",
"price": 49.99,
"source": "string value",
"product_page_id": "string value"
});
});

Product added to wishlist

Anchor link to

Stay informed of the products that users have saved to their wishlists and create personal offers and promo campaigns.

Recommended attributes:

  • product_id: String
  • wishlist_id: String
  • product_price: decimal (price)
  • source: String
  • user_id: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Product added to wishlist", {
"product_id": "string value",
"wishlist_id": "string value",
"product_price": 49.99,
"source": "string value",
"user_id": "string value"
});
});

Product removed from wishlist

Anchor link to

Fire this event when a user deletes a product from their wishlist.

Recommended attributes:

  • user_id: String
  • wishlist_id: String
  • product_id: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Product removed from wishlist", {
"wishlist_id": "string value",
"user_id": "string value",
"product_id": "string value"
});
});

Product category

Anchor link to

Send this event when a user purchases a product of a specific category.

Recommended attributes:

  • product_id: String
  • product_category: String
  • currency: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Product category", {
"product_id": "string value",
"product_category": "string value",
"currency": "string value"
});
});

First purchase

Anchor link to

Trigger this event once a user makes their first purchase.

Recommended attributes:

  • product_id: String,
  • category: String
  • date: Date
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("First purchase", {
"product_id": "string value",
"category": "string value",
"date": new Date()
});
});