ตัวอย่าง 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 ทุกประการ });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "attribute 1" : "string value", // ชื่อและประเภทของแอตทริบิวต์ต้องตรงกับใน Control Panel ทุกประการ "attribute 2" : "string value" // ชื่อและประเภทของแอตทริบิวต์ต้องตรงกับใน Control Panel ทุกประการ]PWInAppManager.shared().postEvent("Event name", withAttributes: attributes) // ชื่ออีเวนต์ต้องตรงกับใน Control Panel ทุกประการ
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"attribute 1" : @"string value", // ชื่อและประเภทของแอตทริบิวต์ต้องตรงกับใน Control Panel ทุกประการ @"attribute 2" : @"string value" // ชื่อและประเภทของแอตทริบิวต์ต้องตรงกับใน Control Panel ทุกประการ};[[PushNotificationManager pushManager] postEvent:@“eventName” withAttributes:attributes]; // ชื่ออีเวนต์ต้องตรงกับใน Control Panel ทุกประการ
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("attribute 1", "string value") // ชื่อและประเภทของแอตทริบิวต์ต้องตรงกับใน Control Panel ทุกประการ .putString("attribute 2", "string value") // ชื่อและประเภทของแอตทริบิวต์ต้องตรงกับใน Control Panel ทุกประการ .build()
PushwooshInApp.getInstance().postEvent("Event name", attributes); // ชื่ออีเวนต์ต้องตรงกับใน 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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "user_id" : "string value", "date" : "date value"]PWInAppManager.shared().postEvent("Log out", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"user_id" : @"string value", @"date" : @"date value"};[[PushNotificationManager pushManager] postEvent:@"Log out" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("user_id", "string value") .putString("date", "date value") .build()
PushwooshInApp.getInstance().postEvent("Log out", attributes);
เพิ่มวิธีการชำระเงินแล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "user_id" : "string value", "payment_method" : "string value"]PWInAppManager.shared().postEvent("Payment method added", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"payment_method" : @"string value", @"user_id" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Payment method added" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("payment_method", "string value") .putString("user_id", "string value") .build()
PushwooshInApp.getInstance().postEvent("Payment method added", attributes);
เปลี่ยนวิธีการชำระเงินแล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "user_id" : "string value", "payment_method" : "string value"]PWInAppManager.shared().postEvent("Payment method changed", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"user_id" : @"string value", @"payment_method" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Payment method changed" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("user_id", "string value") .putString("payment_method", "string value") .build()
PushwooshInApp.getInstance().postEvent("Payment method changed", attributes);
คลิกปุ่มแล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "user_id" : "string value", "button_link" : "string value"]PWInAppManager.shared().postEvent("Button clicked", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"user_id" : @"string value", @"button_link" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Button clicked" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("user_id", "string value") .putString("button_link", "string value") .build()
PushwooshInApp.getInstance().postEvent("Button clicked", attributes);
อัปเดตแอปพลิเคชันแล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "previous_app_version" : "string value"]PWInAppManager.shared().postEvent("Application updated", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"previous_app_version" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Application updated" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("previous_app_version", "string value") .build()
PushwooshInApp.getInstance().postEvent("Application updated", attributes);
อัปเดตระบบปฏิบัติการแล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "previous_OS_version" : "string value", "new_OS_version": "string value"]PWInAppManager.shared().postEvent("OS updated", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"previous_OS_version" : @"string value", @"new_OS_version" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"OS updated" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("previous_OS_version", "string value") .putString("new_OS_version", "string value") .build()
PushwooshInApp.getInstance().postEvent("OS updated", attributes);
อีคอมเมิร์ซ
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "price" : 1, "product_id" : "string value", "source" : "string value"]PWInAppManager.shared().postEvent("Product added to cart", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"price" : @(1), @"product_id" : @"string value", @"source" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Product added to cart" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putInt("price", 1) .putString("product_id", "string value") .putString("source", "string value") .build()
PushwooshInApp.getInstance().postEvent("Product added to cart", attributes);
ซื้อสินค้าพร้อมส่วนลด
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "product_id" : "string value", "coupon_id" : "string value", "price" : 1, "discount" : "string value"]PWInAppManager.shared().postEvent("Discounted purchase", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"product_id" : @"string value", @"coupon_id" : @"string value", @"price" : @(1), @"discount" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Discounted purchase" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("product_id", "string value") .putString("coupon_id", "string value") .putInt("price", 1) .putString("discount", "string value") .build()
PushwooshInApp.getInstance().postEvent("Discounted purchase", attributes);
ออกจากหน้าสินค้า
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "product_id" : "string value", "price" : 1, "source" : "string value", "product_page_id" : "string value"]PWInAppManager.shared().postEvent("Product Page abandoned", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"product_id" : @"string value", @"price" : @(1), @"source" : @"string value", @"product_page_id" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Product Page abandoned" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("product_id", "string value") .putInt("price", 1) .putString("source", "string value") .putString("product_page_id", "string value") .build()
PushwooshInApp.getInstance().postEvent("Product Page abandoned", attributes);
เพิ่มสินค้าในสิ่งที่อยากได้แล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "product_id" : "string value", "wishlist_id" : "string value", "product_price" : 1, "source" : "string value", "user_id" : "string value"]PWInAppManager.shared().postEvent("Product added to wishlist", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"product_id" : @"string value", @"wishlist_id" : @"string value", @"product_price" : @(1), @"source" : @"string value", @"user_id" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Product added to wishlist" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("product_id", "string value") .putString("wishlist_id", "string value") .putInt("product_price", 1) .putString("source", "string value") .putString("user_id", "string value") .build()
PushwooshInApp.getInstance().postEvent("Product added to wishlist", attributes);
ลบสินค้าออกจากสิ่งที่อยากได้แล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "wishlist_id" : "string value", "user_id" : "string value", "product_id" : "string value"]PWInAppManager.shared().postEvent("Product removed from wishlist", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"wishlist_id" : @"string value", @"user_id" : @"string value", @"product_id" : @"string value"};[[PushNotificationManager pushManager] postEvent:@Product removed from wishlist" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("wishlist_id", "string value") .putString("user_id", "string value") .putString("product_id", "string value") .build()
PushwooshInApp.getInstance().postEvent("Product removed from wishlist", attributes);
หมวดหมู่สินค้า
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "product_id" : "string value", "product_category" : "string value", "currency" : "string value"]PWInAppManager.shared().postEvent("Product category", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"product_id" : @"string value", @"product_category" : @"string value", @"currency" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Product category" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("product_id", "string value") .putString("product_category", "string value") .putString("currency", "string value") .build()
PushwooshInApp.getInstance().postEvent("Product category", attributes);
การซื้อครั้งแรก
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "product_id" : "string value", "category" : "string value", "date" : "date value"]PWInAppManager.shared().postEvent("First purchase", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"product_id" : @"string value", @"category" : @"string value", @"date" : @"date value"};[[PushNotificationManager pushManager] postEvent:@"First purchase" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("product_id", "string value") .putString("category", "string value") .putBoolean("date", "date value") .build()
PushwooshInApp.getInstance().postEvent("First purchase", attributes);
แอปเกม
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "level_id" : "string value", "user_id" : "string value"]PWInAppManager.shared().postEvent("New level", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"level_id" : @"string value", @"user_id" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"New level" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("level_id", "string value") .putString("user_id", "string value") .build()
PushwooshInApp.getInstance().postEvent("New level", attributes);
ผ่านเลเวลแล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "level_id" : "string value", "user_id" : "string value"]PWInAppManager.shared().postEvent("Level completed", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"level_id" : @"string value", @"user_id" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Level completed" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("level_id", "string value") .putString("user_id", "string value") .build()
PushwooshInApp.getInstance().postEvent("Level completed", attributes);
ได้รับเงินเสมือน
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "currency_name" : "string value", "quantity" : 1, "user_id" : "string value"]PWInAppManager.shared().postEvent("Virtual currency earned", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"currency_name" : @"string value", @"quantity" : @(1), @"user_id" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Virtual currency earned" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("currency_name", "string value") .putInt("quantity", 1) .putString("user_id", "string value") .build()
PushwooshInApp.getInstance().postEvent("Virtual currency earned", attributes);
ผ่านบทช่วยสอนแล้ว
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 });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "tutorial_name" : "string value", "completion" : true]PWInAppManager.shared().postEvent("Tutorial completed", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"tutorial_name" : @"string value", @"completion" : @YES};[[PushNotificationManager pushManager] postEvent:@"Tutorial completed" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("tutorial_name", "string value") .putBoolean("completion", true) .build()
PushwooshInApp.getInstance().postEvent("Tutorial completed", attributes);
ปลดล็อกความสำเร็จแล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "achievement_name" : "string value", "level" : 5, "user_id": "string value"]PWInAppManager.shared().postEvent("Achievement unlocked", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"achievement_name" : @"string value", @"level" : @1, @"user_id" : "string value"};[[PushNotificationManager pushManager] postEvent:@"Achievement unlocked" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("achievemnt_name", "string value") .putString("level", 1) .putString("user_id", "string value) .build()
PushwooshInApp.getInstance().postEvent("Achievement unlocked", attributes);
การจัดการการสมัครสมาชิก
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()" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "subscription_plan_name" : "string value", "price" : 1, "currency" : "string value", "expiry_date" : NSDate()]PWInAppManager.shared().postEvent("Paid subscription purchase", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"subscription_plan_name" : @"string value", @"price" : @(1), @"currency" : @"string value", @"expiry_date" : [NSDate date]};[[PushNotificationManager pushManager] postEvent:@"Paid subscription purchase" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("subscription_plan_name", "string value") .putInt("price", 1) .putString("currency", "string value") .putDate("expiry_date", new Date()) .build()
PushwooshInApp.getInstance().postEvent("Paid subscription purchase", attributes);
ต่ออายุการสมัครสมาชิก
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 });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "subscription_plan_name" : "string value", "price" : 1, "currency" : "string value", "renewal_count" : 1]PWInAppManager.shared().postEvent("Subscription renewal", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"subscription_plan_name" : @"string value", @"price" : @(1), @"currency" : @"string value", @"renewal_count" : @(1)};[[PushNotificationManager pushManager] postEvent:@"Subscription renewal" withAttributes:attributes];
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("subscription_plan_name", "string value") .putInt("price", 1) .putString("currency", "string value") .putInt("renewal_count", 1) .build()
PushwooshInApp.getInstance().postEvent("Subscription renewal", attributes);
เริ่มทดลองใช้ฟรีแล้ว
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()" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "free_trial_name" : "string value", "expiry_date" : NSDate()]PWInAppManager.shared().postEvent("Free trial started", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"free_trial_name" : @"string value", @"expiry_date" : [NSDate date]};[[PushNotificationManager pushManager] postEvent:@"Free trial started" withAttributes:attributes];
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("free_trial_name", "string value") .putDate("expiry_date", new Date()) .build()
PushwooshInApp.getInstance().postEvent("Free trial started", attributes);
ยกเลิกการสมัครสมาชิกแล้ว
Anchor link toใช้อีเวนต์นี้เพื่อติดตามการยกเลิกการสมัครสมาชิกในแอป
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:
const Pushwoosh = window.Pushwoosh || [];Pushwoosh.push(function(api) { api.postEvent("Subscription cancelled");});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
PWInAppManager.shared().postEvent("Subscription cancelled", withAttributes: nil)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
[[PushNotificationManager pushManager] postEvent:@"Subscription canceled" withAttributes:@{}];
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
PushwooshInApp.getInstance().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()" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "plan_name" : "string value", "price" : 1, "currency" : "string value", "date" : NSDate()]PWInAppManager.shared().postEvent("Conversion from Free to Paid", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"subscription_plan_name" : @"string value", @"price" : @(1), @"currency" : @"string value", @"date" : [NSDate date]};[[PushNotificationManager pushManager] postEvent:@"Conversion from Free to Paid" withAttributes:attributes];
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("subscription_plan_name", "string value") .putInt("price", 1) .putString("currency", "string value") .putDate("date", new Date()) .build()
PushwooshInApp.getInstance().postEvent("Conversion from Free to Paid", attributes);
มีเดีย
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "search_query" : "string value", "category" : "string value"]PWInAppManager.shared().postEvent("Search", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"search_query" : @"string value", @"category" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Search" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("search_query", "string value") .putString("category", "string value") .build()
PushwooshInApp.getInstance().postEvent("Search", attributes);
อ่านเนื้อหาแล้ว
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()" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "category" : "string value", "article_id" : "string value", "author" : "string value", "published_date" : NSDate()]PWInAppManager.shared().postEvent("Content read", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"category" : @"string value", @"article_id" : @"string value", @"author" : @"string value", @"published_date" : [NSDate date]};[[PushNotificationManager pushManager] postEvent:@"Content read" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("category", "string value") .putString("article_id", "string value") .putString("author", "string value") .putDate("published_date", new Date()) .build()
PushwooshInApp.getInstance().postEvent("Content read", attributes);
ส่งแบบฟอร์มแล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "form_name" : "string value", "url" : "string value"]PWInAppManager.shared().postEvent("Form submission", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"form_name" : @"string value", @"url" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Form submission" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("form_name", "string value") .putString("url", "string value") .build()
PushwooshInApp.getInstance().postEvent("Form submission", attributes);
แชร์เนื้อหาแล้ว
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" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "category" : "string value", "article_id" : "string value", "author" : "string value", "published_date" : NSDate(), "button_id" : "string value", "social_media" : "string value"]PWInAppManager.shared().postEvent("Content shared", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"category" : @"string value", @"article_id" : @"string value", @"author" : @"string value", @"published_date" : [NSDate date], @"button_id" : @"string value", @"social_media" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Content shared" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("category", "string value") .putString("article_id", "string value") .putString("author", "string value") .putDate("published_date", new Date()) .putString("button_id", "string value") .putString("social_media", "string value") .build()
PushwooshInApp.getInstance().postEvent("Content shared", attributes);
การตั้งค่าเนื้อหาที่สนใจ
Anchor link toส่งอีเวนต์นี้เมื่อผู้ใช้เลือกหัวข้อเฉพาะที่พวกเขาสนใจ
แอตทริบิวต์ที่แนะนำ:
- topic: String
// หากต้องการใช้กับ Web Push SDK คุณสามารถผสานรวมโค้ดนี้:const Pushwoosh = window.Pushwoosh || [];Pushwoosh.push(function(api) { api.postEvent("Content preferences", { "topic": "string value" });});
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
let attributes: [String : Any] = [ "topic" : "string value"]PWInAppManager.shared().postEvent("Content preferences", withAttributes: attributes)
// หากต้องการใช้กับ iOS SDK คุณสามารถผสานรวมโค้ดนี้:
NSDictionary *attributes = @{ @"topic" : @"string value"};[[PushNotificationManager pushManager] postEvent:@"Content preferences" withAttributes:attributes];
// หากต้องการใช้กับ Android SDK คุณสามารถผสานรวมโค้ดนี้:
TagsBundle attributes = new TagsBundle.Builder() .putString("topic", "string value") .build()
PushwooshInApp.getInstance().postEvent("Content preferences", attributes);