Track and react to user behavior with easy-to-integrate recommended events for e-commerce apps
Below, you'll find a bunch of in-app events recommended for your app category. We based our choice on industry-specific best practices and experts' advice. By tracking these selected events, you can improve your behavioral segmentation and perform more effective, user-centric messaging campaigns.
To implement any of these or other events:
create the Event in your Pushwoosh Control Panel, add attributes if needed;
integrate the postEvent method into your mobile project providing the event name and attributes names are exactly the same as in the Control Panel.
// To use with Web Push SDK, you can integrate this code:constPushwoosh=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 });});
// To use with iOS SDK, you can integrate this code:let attributes: [String:Any] = ["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]PWInAppManager.shared().postEvent("Event name", withAttributes: attributes)// event name exactly as in Control Pane
// To use with iOS SDK, you can integrate this code:
NSDictionary *attributes = @{
@"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
};
[[PushNotificationManager pushManager] postEvent:@“eventName” withAttributes:attributes]; // event name exactly as in Control Panel
// To use with Android SDK, you can integrate this code:TagsBundle attributes =new TagsBundle.Builder().putString("attribute 1","string value") //attribute name and type exactly as in Control Panel.putString("attribute 2","string value") //attribute name and type exactly as in Control Panel.build()PushwooshInApp.getInstance().postEvent("Event name", attributes); // event name exactly as in Control Panel
The samples below can be simply pasted into your app, provided there is a corresponding Event and its attributes are created in your Control Panel. Once integrated, the event data will be collected and become available in Audience -> Events -> Event statistics, and you will be able to use the event in campaign planning.
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: Integer
source: String
// To use with Web Push SDK, you can integrate this code:constPushwoosh=window.Pushwoosh || [];Pushwoosh.push(function(api) {api.postEvent("Product added to cart", {"product_id":"string value","price":1,"source":"string value" });});
// To use with iOS SDK, you can integrate this code:let attributes: [String:Any] = ["price":1,"product_id":"string value","source":"string value"]PWInAppManager.shared().postEvent("Product added to cart", withAttributes: attributes)
// To use with iOS SDK, you can integrate this code:
NSDictionary *attributes = @{
@"price" : @(1),
@"product_id" : @"string value",
@"source" : @"string value"
};
[[PushNotificationManager pushManager] postEvent:@"Product added to cart" withAttributes:attributes];
// To use with Android SDK, you can integrate this code: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);
Discounted purchase
Trigger this event once a user purchases any product using a discount coupon.
Recommended attributes:
product_id: String
coupon_id: String
price: Integer
discount: String
// To use with Web Push SDK, you can integrate this code:constPushwoosh=window.Pushwoosh || [];Pushwoosh.push(function(api) {api.postEvent("Discounted purchase", {"product_id":"string value","coupon_id":"string value","price":1,"discount":"string value" });});
// To use with iOS SDK, you can integrate this code:let attributes: [String:Any] = ["product_id":"string value","coupon_id":"string value","price":1,"discount":"string value"]PWInAppManager.shared().postEvent("Discounted purchase", withAttributes: attributes)
// To use with iOS SDK, you can integrate this code:
NSDictionary *attributes = @{
@"product_id" : @"string value",
@"coupon_id" : @"string value",
@"price" : @(1),
@"discount" : @"string value"
};
[[PushNotificationManager pushManager] postEvent:@"Discounted purchase" withAttributes:attributes];
// To use with Android SDK, you can integrate this code: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);
Product Page abandoned
Fire this event when a user leaves a product page without a conversion action.
Recommended attributes:
product_id: String
price: Integer
source: String
product_page_id: String
// To use with Web Push SDK, you can integrate this code:constPushwoosh=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" });});
// To use with iOS SDK, you can integrate this code: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)
// To use with iOS SDK, you can integrate this code:
NSDictionary *attributes = @{
@"product_id" : @"string value",
@"price" : @(1),
@"source" : @"string value",
@"product_page_id" : @"string value"
};
[[PushNotificationManager pushManager] postEvent:@"Product Page abandoned" withAttributes:attributes];
// To use with Android SDK, you can integrate this code: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);
Product added to wishlist
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: Integer
source: String
user_id: String
// To use with Web Push SDK, you can integrate this code:constPushwoosh=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" });});
// To use with iOS SDK, you can integrate this code: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)
// To use with iOS SDK, you can integrate this code:
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];
// To use with Android SDK, you can integrate this code: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);
Product removed from wishlist
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:constPushwoosh=window.Pushwoosh || [];Pushwoosh.push(function(api) {api.postEvent("Product removed from wishlist", {"wishlist_id":"string value","user_id":"string value","product_id":"string value" });});
// To use with iOS SDK, you can integrate this code: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)
// To use with iOS SDK, you can integrate this code:
NSDictionary *attributes = @{
@"wishlist_id" : @"string value",
@"user_id" : @"string value",
@"product_id" : @"string value"
};
[[PushNotificationManager pushManager] postEvent:@Product removed from wishlist" withAttributes:attributes];
// To use with Android SDK, you can integrate this code: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);
Product category
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:constPushwoosh=window.Pushwoosh || [];Pushwoosh.push(function(api) {api.postEvent("Product category", {"product_id":"string value","product_category":"string value","currency":"string value" });});
// To use with iOS SDK, you can integrate this code:let attributes: [String:Any] = ["product_id":"string value","product_category":"string value","currency":"string value"]PWInAppManager.shared().postEvent("Product category", withAttributes: attributes)
// To use with iOS SDK, you can integrate this code:
NSDictionary *attributes = @{
@"product_id" : @"string value",
@"product_category" : @"string value",
@"currency" : @"string value"
};
[[PushNotificationManager pushManager] postEvent:@"Product category" withAttributes:attributes];
// To use with Android SDK, you can integrate this code: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);
First purchase
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:constPushwoosh=window.Pushwoosh || [];Pushwoosh.push(function(api) {api.postEvent("First purchase", {"product_id":"string value","category":"string value","date":"date value" });});
// To use with iOS SDK, you can integrate this code:let attributes: [String:Any] = ["product_id":"string value","category":"string value","date":"date value"]PWInAppManager.shared().postEvent("First purchase", withAttributes: attributes)
// To use with iOS SDK, you can integrate this code:
NSDictionary *attributes = @{
@"product_id" : @"string value",
@"category" : @"string value",
@"date" : @"date value"
};
[[PushNotificationManager pushManager] postEvent:@"First purchase" withAttributes:attributes];
// To use with Android SDK, you can integrate this code: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);