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

ตัวอย่าง Custom events

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

ในการนำอีเวนต์เหล่านี้หรืออีเวนต์อื่นๆ ไปใช้:

  • สร้างอีเวนต์ใน Pushwoosh Control Panel ของคุณและเพิ่มแอตทริบิวต์หากจำเป็น
  • ผสานรวมเมธอด postEvent เข้ากับโปรเจกต์มือถือของคุณ โดยระบุชื่อของอีเวนต์และแอตทริบิวต์ให้ตรงกับที่อยู่ใน Control Panel ทุกประการ
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Event name", { // ชื่ออีเวนต์ต้องตรงกับใน Control Panel ทุกประการ
"attribute 1": "string value", // ชื่อและประเภทของแอตทริบิวต์ต้องตรงกับใน Control Panel ทุกประการ
"attribute 2": "string value" // ชื่อและประเภทของแอตทริบิวต์ต้องตรงกับใน Control Panel ทุกประการ
});
});

แอปพลิเคชันมือถือ

Anchor link to

ออกจากระบบ

Anchor link to

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

แอตทริบิวต์ที่แนะนำ:

  • user_id: String
  • date: Date
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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

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

แอตทริบิวต์ที่แนะนำ:

  • product_id: String
  • price: Integer
  • source: String
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Product added to cart", {
"product_id": "string value",
"price": 1,
"source": "string value"
});
});

ซื้อสินค้าพร้อมส่วนลด

Anchor link to

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

แอตทริบิวต์ที่แนะนำ:

  • product_id: String
  • coupon_id: String
  • price: Integer
  • discount: String
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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"
});
});

ออกจากหน้าสินค้า

Anchor link to

ส่งอีเวนต์นี้เมื่อผู้ใช้ออกจากหน้าสินค้าโดยไม่มีการกระทำที่นำไปสู่การซื้อ (conversion)

แอตทริบิวต์ที่แนะนำ:

  • product_id: String
  • price: Integer
  • source: String
  • product_page_id: String
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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"
});
});

เพิ่มสินค้าในสิ่งที่อยากได้แล้ว

Anchor link to

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

แอตทริบิวต์ที่แนะนำ:

  • product_id: String
  • wishlist_id: String
  • product_price: Integer
  • source: String
  • user_id: String
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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"
});
});

ลบสินค้าออกจากสิ่งที่อยากได้แล้ว

Anchor link to

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

แอตทริบิวต์ที่แนะนำ:

  • user_id: String
  • wishlist_id: String
  • product_id: String
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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

เลเวลใหม่

Anchor link to

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

แอตทริบิวต์ที่แนะนำ:

  • level_id: String
  • user_id: String
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Achievement unlocked", {
"achievemnt_name": "string value",
"level": 5,
"user_id": "string value"
});
});

การจัดการการสมัครสมาชิก

Anchor link to

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

Anchor link to

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

แอตทริบิวต์ที่แนะนำ:

  • subscription_plan_name: String
  • price: Integer
  • currency:String
  • expiry_date:Date
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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()"
});
});

ต่ออายุการสมัครสมาชิก

Anchor link to

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

แอตทริบิวต์ที่แนะนำ:

  • subscription_plan_name: String
  • price: Integer
  • currency: String
  • renewal_count: Integer
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
});
});

เริ่มทดลองใช้ฟรีแล้ว

Anchor link to

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

แอตทริบิวต์ที่แนะนำ:

  • free_trial_name: String
  • expiry_date: Date
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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

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

// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Subscription cancelled");
});

เปลี่ยนจากเวอร์ชันฟรีเป็นแบบชำระเงิน

Anchor link to

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

แอตทริบิวต์ที่แนะนำ:

  • subscription_plan_name: String
  • price: Integer
  • currency: String
  • date:Date
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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()"
});
});

มีเดีย

Anchor link to

ค้นหา

Anchor link to

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

แอตทริบิวต์ที่แนะนำ:

  • search_query: String
  • category: String
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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

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

แอตทริบิวต์ที่แนะนำ:

  • form_name: String
  • url: String
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
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
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("Content preferences", {
"topic": "string value"
});
});