Links
📱

Recommended Events for Mobile Apps

Track and react to user behavior with easy-to-integrate recommended events for mobile 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 an Event in your Pushwoosh Control Panel and add attributes if needed;
  • integrate the postEvent method into your mobile project, providing the name of the event and its attributes exactly as they are in the Control Panel.
JavaScript
Swift
Objective-C
Java
// 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
});
});
// 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.

Log out

Trigger this event when users log out of their accounts in your app.
Recommended attributes:
  • user_id: String
  • date: Date
JavaScript
Swift
Objective-C
Java
// 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"
});
});
// To use with iOS SDK, you can integrate this code:
​
let attributes: [String : Any] = [
"user_id" : "string value",
"date" : "date value"
]
PWInAppManager.shared().postEvent("Log out", withAttributes: attributes)
// To use with iOS SDK, you can integrate this code:
​
NSDictionary *attributes = @{
@"user_id" : @"string value",
@"date" : @"date value"
};
[[PushNotificationManager pushManager] postEvent:@"Log out" withAttributes:attributes];
// To use with Android SDK, you can integrate this code:
​
TagsBundle attributes = new TagsBundle.Builder()
.putString("user_id", "string value")
.putString("date", "date value")
.build()
​
PushwooshInApp.getInstance().postEvent("Log out", attributes);

Payment method added

Fire this event when a user adds a payment method to their account in your app, e.g. provides card credentials or links the account to a payment system.
Recommended attributes:
  • payment_method: String,
  • user_id: String
JavaScript
Swift
Objective-C
Java
// 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"
});
});
// To use with iOS SDK, you can integrate this code:
​
let attributes: [String : Any] = [
"user_id" : "string value",
"payment_method" : "string value"
]
PWInAppManager.shared().postEvent("Payment method added", withAttributes: attributes)
// To use with iOS SDK, you can integrate this code:
​
NSDictionary *attributes = @{
@"payment_method" : @"string value",
@"user_id" : @"string value"
};
[[PushNotificationManager pushManager] postEvent:@"Payment method added" withAttributes:attributes];
// To use with Android SDK, you can integrate this code:
​
TagsBundle attributes = new TagsBundle.Builder()
.putString("payment_method", "string value")
.putString("user_id", "string value")
.build()
​
PushwooshInApp.getInstance().postEvent("Payment method added", attributes);

Payment method changed

Send this event when a user updates their payment method in the app.
Recommended attributes:
  • user_id: String,
  • payment_method: String
JavaScript
Swift
Objective-C
Java
// 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"
});
});
// To use with iOS SDK, you can integrate this code:
​
let attributes: [String : Any] = [
"user_id" : "string value",
"payment_method" : "string value"
]
PWInAppManager.shared().postEvent("Payment method changed", withAttributes: attributes)
// To use with iOS SDK, you can integrate this code:
​
NSDictionary *attributes = @{
@"user_id" : @"string value",
@"payment_method" : @"string value"
};
[[PushNotificationManager pushManager] postEvent:@"Payment method changed" withAttributes:attributes];
// To use with Android SDK, you can integrate this code:
​
TagsBundle attributes = new TagsBundle.Builder()
.putString("user_id", "string value")
.putString("payment_method", "string value")
.build()
​
PushwooshInApp.getInstance().postEvent("Payment method changed", attributes);

Button clicked

Track button clicks within the app with this event to improve your analytics, test various communication strategies, and increase relevance of your messages based on customer behavior.
Recommended event attributes:
  • user_id: String
  • button_link: String
JavaScript
Swift
Objective-C
Java
// 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"
});
});
// To use with iOS SDK, you can integrate this code:
​
let attributes: [String : Any] = [
"user_id" : "string value",
"button_link" : "string value"
]
PWInAppManager.shared().postEvent("Button clicked", withAttributes: attributes)
// To use with iOS SDK, you can integrate this code:
​
NSDictionary *attributes = @{
@"user_id" : @"string value",
@"button_link" : @"string value"
};
[[PushNotificationManager pushManager] postEvent:@"Button clicked" withAttributes:attributes];
// To use with Android SDK, you can integrate this code:
​
TagsBundle attributes = new TagsBundle.Builder()
.putString("user_id", "string value")
.putString("button_link", "string value")
.build()
​
PushwooshInApp.getInstance().postEvent("Button clicked", attributes);
​

Application updated

Trigger this event every time a user installs an updated version of your app.
Recommended attributes:
  • previous_app_version: String
JavaScript
Swift
Objective-C
Java
// 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"
});
});
// To use with iOS SDK, you can integrate this code:
​
let attributes: [String : Any] = [
"previous_app_version" : "string value"
]
PWInAppManager.shared().postEvent("Application updated", withAttributes: attributes)
// To use with iOS SDK, you can integrate this code:
​
NSDictionary *attributes = @{
@"previous_app_version" : @"string value"
};
[[PushNotificationManager pushManager] postEvent:@"Application updated" withAttributes:attributes];
// To use with Android SDK, you can integrate this code:
​
TagsBundle attributes = new TagsBundle.Builder()
.putString("previous_app_version", "string value")
.build()
​
PushwooshInApp.getInstance().postEvent("Application updated", attributes);

OS updated

Fire this event when a user updates their device's OS version to ensure your app is fully compliant.
Recommended attributes:
  • previous_OS_version: String
  • new_OS_version: String
JavaScript
Swift
Objective-C
Java
// 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"
});
});
// To use with iOS SDK, you can integrate this code:
​
let attributes: [String : Any] = [
"previous_OS_version" : "string value",
"new_OS_version": "string value"
]
PWInAppManager.shared().postEvent("OS updated", withAttributes: attributes)
// To use with iOS SDK, you can integrate this code:
​
NSDictionary *attributes = @{
@"previous_OS_version" : @"string value",
@"new_OS_version" : @"string value"
};
[[PushNotificationManager pushManager] postEvent:@"OS updated" withAttributes:attributes];
// To use with Android SDK, you can integrate this code:
​
TagsBundle attributes = new TagsBundle.Builder()
.putString("previous_OS_version", "string value")
.putString("new_OS_version", "string value")
.build()
​
PushwooshInApp.getInstance().postEvent("OS updated", attributes);