Skip to content

Custom events examples

Below, you’ll find a bunch of in-app events recommended for different app categories.

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.
// 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
});
});

Mobile apps

Log out

Trigger this event when users log out of their accounts in your app.

Recommended 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

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
// 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

Send this event when a user updates their payment method in the app.

Recommended 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

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
// 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

Trigger this event every time a user installs an updated version of your app.

Recommended 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

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
// 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

Product added to cart

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:
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

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:
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

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:
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

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:
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

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:
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

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:
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

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:
const Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(function(api) {
api.postEvent("First purchase", {
"product_id": "string value",
"category": "string value",
"date": "date value"
});
});

Gaming Apps

New level

When a user reaches a new game level, trigger the New level event.

Recommended 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

Send this event when a user completes a particular game level.

Recommended 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

Fire this event when a user’s virtual currency balance tops up.

Recommended 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

Trigger this event when a user completes the in-game tutorial.

Recommended 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

Monitor user engagement with the event fired when a user unlocks a specific achievement.

Recommended 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", {
"achievemnt_name": "string value",
"level": 5,
"user_id": "string value"
});
});

Subscription Management

Send this event when a user has bought a paid subscription plan.

Recommended 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

Trigger this event once a user renews their subscription plan.

Recommended 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

Trigger this event when a user chooses to start a free trial before getting a subscription.

Recommended 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

Use this event to track in-app subscription cancelations.

// 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

Trigger this event once a user converts from using your app for free to a paid subscription plan.

Recommended 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

Send this event when a user searches for any content in your app.

Recommended 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

Trigger this event when a user has read a specific piece of content.

Recommended 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

Track submissions of your in-app forms (for example, Net Promoter Score), the choice of content preferences, and other surveys.

Recommended 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

Trigger this event when a user has shared a piece of content via social networks, email or other channels.

Recommended 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

Fire this event when a user chooses a specific topic they are interested in.

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