ข้ามไปยังเนื้อหา

ตัวอย่าง Custom events

ด้านล่างนี้คือรายการ event ในแอปที่แนะนำสำหรับแอปหมวดหมู่ต่างๆ

ในการนำ event เหล่านี้หรือ event อื่นๆ ไปใช้งาน:

  • สร้าง Event ใน Pushwoosh Control Panel ของคุณและเพิ่ม attributes หากจำเป็น
  • ผสานรวมเมธอด postEvent เข้ากับโปรเจกต์มือถือของคุณ โดยระบุชื่อของ event และ attributes ให้ตรงกับที่อยู่ใน Control Panel ทุกประการ
// 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

ออกจากระบบ (Log out)

Anchor link to

ทริกเกอร์ event นี้เมื่อผู้ใช้ออกจากระบบบัญชีของตนในแอปของคุณ

Attributes ที่แนะนำ:

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

เพิ่มวิธีการชำระเงิน (Payment method added)

Anchor link to

ส่ง event นี้เมื่อผู้ใช้เพิ่มวิธีการชำระเงินในบัญชีของตนในแอปของคุณ เช่น ให้ข้อมูลบัตรเครดิตหรือเชื่อมโยงบัญชีกับระบบชำระเงิน

Attributes ที่แนะนำ:

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

เปลี่ยนวิธีการชำระเงิน (Payment method changed)

Anchor link to

ส่ง event นี้เมื่อผู้ใช้อัปเดตวิธีการชำระเงินในแอป

Attributes ที่แนะนำ:

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

คลิกปุ่ม (Button clicked)

Anchor link to

ติดตามการคลิกปุ่มภายในแอปด้วย event นี้เพื่อปรับปรุงการวิเคราะห์ของคุณ ทดสอบกลยุทธ์การสื่อสารต่างๆ และเพิ่มความเกี่ยวข้องของข้อความของคุณตามพฤติกรรมของลูกค้า

Attributes ของ event ที่แนะนำ:

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

อัปเดตแอปพลิเคชัน (Application updated)

Anchor link to

ทริกเกอร์ event นี้ทุกครั้งที่ผู้ใช้ติดตั้งแอปของคุณเวอร์ชันที่อัปเดตแล้ว

Attributes ที่แนะนำ:

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

อัปเดตระบบปฏิบัติการ (OS updated)

Anchor link to

ส่ง event นี้เมื่อผู้ใช้อัปเดตเวอร์ชัน OS ของอุปกรณ์เพื่อให้แน่ใจว่าแอปของคุณเข้ากันได้อย่างสมบูรณ์

Attributes ที่แนะนำ:

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

อีคอมเมิร์ซ (E-Commerce)

Anchor link to

เพิ่มสินค้าลงในตะกร้า (Product added to cart)

Anchor link to

ส่ง event นี้เมื่อผู้ใช้เพิ่มสินค้าลงในตะกร้าเพื่อสร้างแคมเปญ Abandoned Cart, ตั้งค่า user tags หรือวิเคราะห์ประสิทธิภาพของโปรโมชันของคุณ

Attributes ที่แนะนำ:

  • product_id: String
  • price: Integer
  • 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": 1,
"source": "string value"
});
});

การซื้อพร้อมส่วนลด (Discounted purchase)

Anchor link to

ทริกเกอร์ event นี้เมื่อผู้ใช้ซื้อสินค้าใดๆ โดยใช้คูปองส่วนลด

Attributes ที่แนะนำ:

  • product_id: String
  • coupon_id: String
  • price: Integer
  • 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": 1,
"discount": "string value"
});
});

ออกจากหน้าสินค้า (Product page abandoned)

Anchor link to

ส่ง event นี้เมื่อผู้ใช้ออกจากหน้าสินค้าโดยไม่มีการกระทำที่เป็น conversion

Attributes ที่แนะนำ:

  • product_id: String
  • price: Integer
  • 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": 1,
"source": "string value",
"product_page_id": "string value"
});
});

เพิ่มสินค้าในสิ่งที่อยากได้ (Product added to wishlist)

Anchor link to

รับทราบข้อมูลสินค้าที่ผู้ใช้บันทึกไว้ในสิ่งที่อยากได้ (wishlists) และสร้างข้อเสนอส่วนตัวและแคมเปญโปรโมชัน

Attributes ที่แนะนำ:

  • product_id: String
  • wishlist_id: String
  • product_price: Integer
  • 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",
"currency": "string value",
"price": 1,
"source": "string value",
"user_id": "string value"
});
});

นำสินค้าออกจากสิ่งที่อยากได้ (Product removed from wishlist)

Anchor link to

ส่ง event นี้เมื่อผู้ใช้ลบสินค้าออกจากสิ่งที่อยากได้ (wishlist)

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

ส่ง event นี้เมื่อผู้ใช้ซื้อสินค้าในหมวดหมู่ที่เฉพาะเจาะจง

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

ทริกเกอร์ event นี้เมื่อผู้ใช้ทำการซื้อครั้งแรก

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

แอปเกม (Gaming Apps)

Anchor link to

เลเวลใหม่ (New level)

Anchor link to

เมื่อผู้ใช้ไปถึงเลเวลใหม่ของเกม ให้ทริกเกอร์ event New level

Attributes ที่แนะนำ:

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

ผ่านเลเวล (Level completed)

Anchor link to

ส่ง event นี้เมื่อผู้ใช้ผ่านเลเวลเกมที่เฉพาะเจาะจง

Attributes ที่แนะนำ:

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

ได้รับเงินเสมือน (Virtual currency earned)

Anchor link to

ส่ง event นี้เมื่อยอดเงินเสมือนของผู้ใช้เพิ่มขึ้น

Attributes ที่แนะนำ:

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

จบบทช่วยสอน (Tutorial completed)

Anchor link to

ทริกเกอร์ event นี้เมื่อผู้ใช้จบบทช่วยสอนในเกม

Attributes ที่แนะนำ:

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

ปลดล็อกความสำเร็จ (Achievement unlocked)

Anchor link to

ติดตามการมีส่วนร่วมของผู้ใช้ด้วย event ที่ส่งเมื่อผู้ใช้ปลดล็อกความสำเร็จที่เฉพาะเจาะจง

Attributes ที่แนะนำ:

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

การจัดการการสมัครสมาชิก (Subscription Management)

Anchor link to

ซื้อการสมัครสมาชิกแบบชำระเงิน (Paid subscription purchase)

Anchor link to

ส่ง event นี้เมื่อผู้ใช้ซื้อแผนการสมัครสมาชิกแบบชำระเงิน

Attributes ที่แนะนำ:

  • subscription_plan_name: String
  • price: Integer
  • 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": 1,
"currency": "string value",
"expiry_date": "new Date()"
});
});

การต่ออายุการสมัครสมาชิก (Subscription renewal)

Anchor link to

ทริกเกอร์ event นี้เมื่อผู้ใช้ต่ออายุแผนการสมัครสมาชิกของตน

Attributes ที่แนะนำ:

  • subscription_plan_name: String
  • price: Integer
  • 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": 1,
"currency": "string value",
"renewal_count": 1
});
});

เริ่มทดลองใช้ฟรี (Free trial started)

Anchor link to

ทริกเกอร์ event นี้เมื่อผู้ใช้เลือกที่จะเริ่มทดลองใช้ฟรีก่อนที่จะสมัครสมาชิก

Attributes ที่แนะนำ:

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

ยกเลิกการสมัครสมาชิก (Subscription canceled)

Anchor link to

ใช้ event นี้เพื่อติดตามการยกเลิกการสมัครสมาชิกในแอป

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

เปลี่ยนจากฟรีเป็นแบบชำระเงิน (Conversion from Free to Paid)

Anchor link to

ทริกเกอร์ event นี้เมื่อผู้ใช้เปลี่ยนจากการใช้แอปของคุณฟรีเป็นแผนการสมัครสมาชิกแบบชำระเงิน

Attributes ที่แนะนำ:

  • subscription_plan_name: String
  • price: Integer
  • 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": 1,
"currency": "string value",
"date": "new Date()"
});
});

สื่อ (Media)

Anchor link to
Anchor link to

ส่ง event นี้เมื่อผู้ใช้ค้นหาเนื้อหาใดๆ ในแอปของคุณ

Attributes ที่แนะนำ:

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

อ่านเนื้อหา (Content read)

Anchor link to

ทริกเกอร์ event นี้เมื่อผู้ใช้อ่านเนื้อหาชิ้นใดชิ้นหนึ่ง

Attributes ที่แนะนำ:

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

การส่งแบบฟอร์ม (Form submission)

Anchor link to

ติดตามการส่งแบบฟอร์มในแอปของคุณ (เช่น Net Promoter Score) การเลือกความชอบด้านเนื้อหา และแบบสำรวจอื่นๆ

Attributes ที่แนะนำ:

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

แชร์เนื้อหา (Content shared)

Anchor link to

ทริกเกอร์ event นี้เมื่อผู้ใช้แชร์เนื้อหาผ่านโซเชียลเน็ตเวิร์ก อีเมล หรือช่องทางอื่นๆ

Attributes ที่แนะนำ:

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

ความชอบด้านเนื้อหา (Content preferences)

Anchor link to

ส่ง event นี้เมื่อผู้ใช้เลือกหัวข้อที่พวกเขาสนใจเป็นพิเศษ

Attributes ที่แนะนำ:

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