跳到内容

自定义事件示例

下面,您将找到针对不同应用类别推荐的一系列应用内事件。

要实现这些或任何其他事件:

  • 在您的 Pushwoosh 控制面板中创建一个事件,并根据需要添加属性;
  • 将 postEvent 方法集成到您的移动项目中,提供与控制面板中完全相同的事件名称及其属性。
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Event name", { // event name exactly as in Control Panel
"attribute 1": "string value", // attribute name and type exactly as in Control Panel
"attribute 2": "string value" // attribute name and type exactly as in Control Panel
});
});

移动应用

Anchor link to

当用户在您的应用中登出其账户时触发此事件。

推荐属性:

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

已添加支付方式

Anchor link to

当用户在其应用账户中添加支付方式时触发此事件,例如提供银行卡凭证或将账户链接到支付系统。

推荐属性:

  • payment_method: 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("Payment method added", {
"user_id": "string value",
"payment_method": "string value"
});
});

已更改支付方式

Anchor link to

当用户在应用中更新其支付方式时发送此事件。

推荐属性:

  • user_id: String,
  • payment_method: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Payment method changed", {
"user_id": "string value",
"payment_method": "string value"
});
});

按钮已点击

Anchor link to

通过此事件跟踪应用内的按钮点击,以改进您的分析、测试各种通信策略,并根据客户行为提高消息的相关性。

推荐事件属性:

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

应用已更新

Anchor link to

每当用户安装您应用的更新版本时触发此事件。

推荐属性:

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

操作系统已更新

Anchor link to

当用户更新其设备的操作系统版本以确保您的应用完全兼容时触发此事件。

推荐属性:

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

电子商务

Anchor link to

商品已查看

Anchor link to

当用户打开商品页面时,触发此事件。可将其用于浏览放弃营销活动,并按用户查看的商品和类别对用户进行细分。

推荐属性:

  • 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"
});
});

商品已添加到购物车

Anchor link to

一旦用户将商品添加到购物车,就触发此事件,以构建“废弃购物车”营销活动、设置用户标签或分析促销活动的效率。

推荐属性:

  • 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"
});
});

结账已开始

Anchor link to

当用户开始结账时,触发此事件。已开始结账但未下单的用户就是结账提醒的受众。

推荐属性:

  • 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
});
});

订单已下单

Anchor link to

当用户完成购买时,触发此事件。将其作为主要购买事件针对每次购买发送;如果折扣购买、商品类别或首次购买也适用,则同时发送这些事件。

推荐属性:

  • order_id: String
  • __amount: decimal (price)
  • __currency: String, 货币代码,例如 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"
});
});

使用 __amount 和 __currency 属性时,Pushwoosh 会在此事件首次到达时自动开始跟踪其收入。请参阅转化事件。

订单已退款

Anchor link to

当订单被全部或部分退款时,触发此事件。可将其用于将这些用户排除在购后营销活动之外,或询问他们退货的原因。

推荐属性:

  • 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"
});
});

折扣购买

Anchor link to

一旦用户使用折扣券购买任何产品,就触发此事件。

推荐属性:

  • 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"
});
});

商品页面已放弃

Anchor link to

当用户离开商品页面而未进行转化操作时触发此事件。

推荐属性:

  • 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"
});
});

商品已添加到心愿单

Anchor link to

随时了解用户保存到心愿单的商品,并创建个性化优惠和促销活动。

推荐属性:

  • 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"
});
});

商品已从心愿单移除

Anchor link to

当用户从心愿单中删除商品时触发此事件。

推荐属性:

  • 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"
});
});

商品类别

Anchor link to

当用户购买特定类别的商品时发送此事件。

推荐属性:

  • 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"
});
});

首次购买

Anchor link to

一旦用户进行首次购买,就触发此事件。

推荐属性:

  • 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": "date value"
});
});

游戏应用

Anchor link to

当用户达到新的游戏关卡时,触发“新关卡”事件。

推荐属性:

  • level_id: 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("New level", {
"level_id": "string value",
"user_id": "string value"
});
});

关卡已完成

Anchor link to

当用户完成特定游戏关卡时发送此事件。

推荐属性:

  • level_id: 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("Level completed", {
"level_id": "string value",
"user_id": "string value"
});
});

获得虚拟货币

Anchor link to

当用户的虚拟货币余额增加时触发此事件。

推荐属性:

  • currency_name: String
  • quantity: Integer
  • user_id: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Virtual currency earned", {
"currency_name": "string value",
"quantity": 1,
"user_id": "string value"
});
});

教程已完成

Anchor link to

当用户完成游戏内教程时触发此事件。

推荐属性:

  • tutorial_name: String
  • completion: Boolean
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Tutorial completed", {
"tutorial_name": "string value",
"completion": true
});
});

成就已解锁

Anchor link to

通过用户解锁特定成就时触发的事件来监控用户参与度。

推荐属性:

  • achievement_name: String
  • level: Integer
  • user_id: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Achievement unlocked", {
"achievement_name": "string value",
"level": 5,
"user_id": "string value"
});
});

订阅管理

Anchor link to

付费订阅购买

Anchor link to

当用户购买了付费订阅计划时发送此事件。

推荐属性:

  • subscription_plan_name: String
  • price: decimal (price)
  • currency:String
  • expiry_date:Date
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Paid subscription purchase", {
"subscription_plan_name": "string value",
"price": 49.99,
"currency": "string value",
"expiry_date": "new Date()"
});
});

订阅续订

Anchor link to

一旦用户续订其订阅计划,就触发此事件。

推荐属性:

  • subscription_plan_name: String
  • price: decimal (price)
  • currency: String
  • renewal_count: Integer
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Subscription renewal", {
"subscription_plan_name": "string value",
"price": 49.99,
"currency": "string value",
"renewal_count": 1
});
});

免费试用已开始

Anchor link to

当用户选择在订阅前开始免费试用时触发此事件。

推荐属性:

  • free_trial_name: String
  • expiry_date: Date
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Free trial started", {
"free_trial_name": "string value",
"expiry_date": "new Date()"
});
});

订阅已取消

Anchor link to

使用此事件跟踪应用内订阅取消情况。

// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Subscription cancelled");
});

从免费转换为付费

Anchor link to

一旦用户从免费使用您的应用转换为付费订阅计划,就触发此事件。

推荐属性:

  • subscription_plan_name: String
  • price: decimal (price)
  • currency: String
  • date: Date
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Conversion from Free to Paid", {
"subscription_plan_name": "string value",
"price": 49.99,
"currency": "string value",
"date": "new Date()"
});
});

当用户在您的应用中搜索任何内容时发送此事件。

推荐属性:

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

内容已阅读

Anchor link to

当用户阅读了特定内容时触发此事件。

推荐属性:

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

表单提交

Anchor link to

跟踪您应用内表单的提交(例如,净推荐值分数)、内容偏好选择以及其他调查。

推荐属性:

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

内容已分享

Anchor link to

当用户通过社交网络、电子邮件或其他渠道分享内容时触发此事件。

推荐属性:

  • category: String
  • article_id: String
  • author: String
  • published_date: Date
  • button_id: String
  • social_media: String
// To use with Web Push SDK, you can integrate this code:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Content shared", {
"category": "string value",
"article_id": "string value",
"author": "string value",
"published_date": "new Date()",
"button_id": "string value",
"social_media": "string value"
});
});

内容偏好

Anchor link to

当用户选择他们感兴趣的特定主题时触发此事件。

推荐属性:

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