Push Campaign Best Practices

This section covers best practices for managing push tokens, tracking delivery metrics, and personalizing campaigns in the Android SDK. Follow these practices to improve token reliability, maximize delivery visibility, and optimize campaign performance.

  • Make sure you enable push in the SDK by using usePushNotifications(true).
  • Call setFirebaseToken() during every app launch sequence. Don’t limit this call to instances when Firebase issues a new token.
  • Call Evergage.getInstance().setFirebaseToken(token) from FirebaseMessagingService.onNewToken().
  • When a token changes, during an app reinstallation or a new token issuance by Firebase, the SDK captures both the previous and new tokens and forwards them to the platform. The platform then deactivates the deprecated token and activates the new one.
  • Tokens are associated with the most recent user set using setUserId. As a result, push campaigns target only the most recent user for each token.
  • To view a user’s registered push endpoints such as their platform, status, and last update timestamp, use the user profile page in the Personalization UI.
  • The SDK doesn’t send empty or null tokens to the server. The SDK ignores duplicate tokens.
  • Tokens are accepted only when the user grants notification permissions at the OS level.
  • During send time, the platform automatically skips users without a valid, enabled token.
  • Empty token updates are discarded by the platform.
  • If a device switches between multiple users, the push token is automatically transferred. The token is deactivated on the previous user profile and activated on the new user profile.
  • Each user can have up to 10 push endpoints per app per platform combination.
  • There is no pre-send API to check token coverage. To evaluate token availability, track campaign send metrics by comparing the number of eligible endpoints against actual sends.
  • The platform detects invalid or disabled tokens at send time, prompting the system to automatically disable the endpoint for all future sends.
  • An expired Firebase server key causes immediate campaign failures that are reflected in the campaign’s error count.
  • When Firebase reports that a message wasn’t delivered (due to an invalid token or an unregistered device), the platform logs the event and increments the campaign’s delivery failure count.

The Personalization UI surfaces the following metrics to track campaign delivery and engagement:

  • Send requests
  • Sends by platform/channel
  • Send errors
  • Delivery failures and delivery failure rate
  • Clickthroughs and clickthrough rate

Clickthrough tracking on Android requires a manual call to trackClickthrough(Intent) or trackClickthrough(Map) when handling notification taps.

Firebase doesn’t acknowledge successful message delivery. The platform infers successful delivery only when no upstream gateway failure is returned. To best measure confirmed delivery, monitor the Clickthrough Rate.

Contextualize push message titles and bodies per recipient at send time using dynamic variables. Supported data types include:

  • User Attributes: ${user.attributes.firstName}

  • Account Data: ${account.attributes.companyName}

  • Location Data: ${user.location.city}

  • Product or Item Data: ${item.name}, ${item.price}, ${item.imageUrl}

Use automatic user assignments in a campaign to deploy multiple experiences.

  • User Percentage (A/B Testing): Splits audiences by percentage with sticky assignments to make sure that the user experience stays consistent.

  • Rules-Based Targeting: Evaluates segment and attribute criteria to match users to specific experiences.

  • Multivariate Testing (MVT): Allocates traffic to percentage-based test groups across dimensions.

Automatically select tailored product recommendations for your users based on user behavior. This feature is powered by the recommendations engine, custom query-based selections, or contextual algorithms, and includes a configurable lookback window for historical behavioral data.

Configure distinct JSON data payloads for iOS and Android within a single unified campaign. These payload configurations support the ingestion of dynamic variables.

Use built-in holdout groups to isolate target segments and accurately measure the incremental impact and lift of your push campaigns.

  • Android 8+ requires notification channels. The SDK doesn’t create notification channels automatically, therefore, make sure the app creates the channels.
  • Android 13+ requires POST_NOTIFICATIONS runtime permission.