On-site messages quick start guide
All you need to know before starting to send on-site messages
On-site messages are messages that are delivered to on-site web users when an event is triggered. Opt-in is not required for this type of message.
Prerequisites: SDK integration
On-site messages require that you configure your web application in your Xtremepush project and that you complete the integration of the Xtremepush SDK in your website.
Add real time events to trigger messages
On-site messages are triggered by real-time events. You need at least one real-time event (for example, a specific page view) to show an on-site message to your end users. Once the SDK is deployed on your website you can add these events easily by calling the JavaScript event method of the SDK.
xtremepush('event', 'EVENT_NAME');
xtremepush('event', 'EVENT_NAME', 'EVENT_VALUE');
Review our guides for more details on events and how they can easily be deployed directly or using a tag manager product like Google Tag Manager and for info on special events such as mouse out and page scroll events.
On-site campaigns can only be configured as a response to real-time events from your website (firing an event from the API cannot trigger an on-site campaign).
Enable the on-site channel
To be able to use the on-site channel, it must first be enabled by a Project or Company Admin user, from Settings > Apps & sites > click on the matching website by toggling the On-site slider and clicking on Enable. No further configuration is required.
Testing...
Running tests is encouraged before start sending on-site campaigns to your customers.
Test on-site messages
Once that you have enabled the on-site channel, you will be able to see On-site message as an available channel from the campaign builder page. On-site messages can only be used in standalone campaigns or combined with in-app campaigns. To create a test campaign go to: Campaigns > Create Campaign > Single-stage and select In-app / On-site message.
You can review more details about how to set up an on-site campaign from this guide. Have a look at our creative guidelines guide for best results.
To easily launch a test campaign you can manually fire an event from your site, with the browser developer tools, by using the SDK event method. Navigate to your site in your browser of choice and open the developer tools. Then navigate to the Console tab and use the following command (in the example we are firing an event called cart.view
:
xtremepush('event', 'cart.view');
An event is created in your project when you fire it for the first time from your website, or you can also manually create it by navigating to Data Manager > Events > Create event.
Once you have fired this event or created it, you will be able to select it for use in your campaign by typing the name into Custom event) within the Events tab]. Configure the rest of options following our guide.
Navigate to the Segment tab to specify the recipients of the campaign. If you have enabled Target Applications, and have integrated more than one website in your project, you can specify which one you want to target, otherwise the content will appear in all of them. If you have multiple users and you want to target a particular one, you can do so by selecting Create Custom Segment > identifier > user ID equals and providing the user ID. This will only work if you have previously set your user ID.
Count recipients before launching the campaign
Whenever launching a campaign it is a best practice to use the Calculate recipients feature to count recipients and make sure that your targeted audience for this campaign is what you are expecting.
Once you have launched the campaign, and in order to test it, you will need to go back to your site and fire the event again. The on-site message should appear immediately after you fire the event.
Troubleshooting: Debug logs
Debug logs allow you to review requests which are being made from your website to the Xtremepush project and detect issues. See our dedicated guide for instructions on how to enable debug logs.
How to obtain your device ID?
Review our dedicated guide to learn how to obtain your device ID.
Updated over 1 year ago