Realtime responses can be triggered from events that come from user behaviour on your mobile apps or websites. They can also be triggered by events on a backend system.
Add events with the SDKs
Responses such as popping up a message, or sending an outbound basket recovery notification, email or sms are triggered by realtime events. These events can be added in Apps and on sites with methods from the mobile and web SDKs.
Mobile
If an event(s) is to be added from your Mobile App then with the SDK deployed you can add events easily by calling a simple method in your iOS or Android App. Trigger events can be added to your App very simply using the eventHit method of the xtremepush SDK:
//Android
mPushConnector.hitEvent("EVENT_NAME");
//iOS
[XPush hitEvent: @"EVENT_NAME"];
If the SDK is not already deployed in your app follow our mobile quick start guides in the channels section which cover installing the SDK and enabling Mobile App specific channels:
It's possible to pass a value with the event hit. It could be used for additional segmentation and personalization of your messages.
To pass a string value with the event use:
//Android
mPushConnector.hitEvent("test", "payload");
//iOS
[XPush hitEvent: @"test" withValue: @"payload"];
To pass key-value pairs with the event use as below it pairs in JSON:
//Android
HashMap <String, String> hm = new HashMap<>(); hm.put("product_category", "Sports"); hm.put("product_name", "Home Jersey"); mPushConnector.hitEvent("product_add_to_basket", hm);
//iOS
[XPush hitEvent: @"product_add_to_basket" withValues: @{@"product_category": @"Sports", @"product_name": @"Home Jersey"}];
Web
If an event(s) is to be added from your website then with the SDK deployed you can add any events easily by calling a simple javascript method. Trigger events can be added to your site very simply using the event method of the xtremepush web SDK:
xtremepush('event', 'EVENT_NAME');
These can also include values similar to tags:
xtremepush('event', 'EVENT_NAME', 'EVENT_VALUE');
and as on mobile you can pass key-value pairs in JSON if required:
xtremepush('event', 'product_add_to_basket', {'product_category':'Sports', 'product_name': 'Home Jersey'});
For more detail on events and how they can easily be added using a tag manager product like GTM and for info on special events such as Mouse Out and Page Scroll see articles linked below:
If the SDK is not already deployed in your app follow our web quick start guides in the channels section which cover installing the SDK and enabling web specific channels:
Create event triggered messaging campaigns
Once you have at least one trigger event then you can create event triggered campaigns. Go to Create Campaign > Event Triggered Message OR In-App / On-Site Message.
These campaign types have the option to be respond to an event in realtime. Any events you have added will be available to add from the events page:
The appropriate response can be to send immediately (required for popping up In-App or On Site Messages) or with a delay if the response is to take the form of an outbound action. Any available outbound channel may be triggered by a realtime event.
If sending with a delay then you pick you will have a start event on the events page. You may also use a real-time event in segmentation as a stop event to not send if a user completes an action within a time frame. A good example is basket recovery where you may send a nudge if the user has triggered an add to basket event but has not completed purchase.
Trigger campaigns from backend systems via API
If an event happens on a backend system then this can also be used to trigger a notification, email, SMS or any other out bound response. To trigger a response from a backend system first create an API triggered campaign on the platform. Go to Create Campaign > API Triggered Message.
The appropriate response can be to send immediately or schedule for later and the response must take the form of an outbound action. Any available outbound channel may be triggered by an API execution.
Full details on how to setup a template and use the API to trigger a message such as a transactional update can be found in the docs here
If you need a general intro to the API then you can visit the API section:
And start by reading the general overview in the docs here:
Remove an inbox message in response to an event
One special action you may want to take in response to an event on your backend system is to remove a message previously placed in a users inbox. One common use case for this is if an inbox message relates to a one-time offer you may want to remove it in when a redemption is confirmed on your backend system. Details on how to remove an inbox message via API here.
Comments
0 comments
Article is closed for comments.