On-site messages quick start guide

All you need to know before starting to send on-site messages

On-site messages are delivered to users browsing your website in response to an event trigger. Opt-in is not required for this type of message. Both SDK and server events can be used to trigger on-site campaigns.

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 events to trigger messages

On-site messages are triggered by SDK or server events.

SDK events

You need at least one real-time event (for example, a specific page view) to show an on-site message to your users. Once the SDK is deployed on your website, you can add these events by calling the JavaScript event method of the SDK.

xtremepush('event', 'EVENT_NAME');

For more information on SDK events and how can they be easily deployed directly or using a tag manager product like Google tag manager see firing events from your website respectively. Review our dedicated guide for more information on special events such as mouse out and page scroll events.

👍

Real-time vs queued

You can only configure real-time on-site messages by specifying SDK event triggers in standalone In-App / On-site campaigns, which are created from Campaigns > Create a campaign > In-app/On-site. SDK events can also be used in multi-channel on-site campaigns but the message will be retrieved using a polling mechanism.

Server events

Server events can include any backend or external events that can be triggered from integrations or through external API using the hit event method. When using these events, the messages sent to your users will be queued and only delivered after they open your application. For more information on deploying server events see Configure Server-triggered messages.

👍

Server events can only be used when you create a standalone on-site campaign. To create a standalone on-site campaign, navigate to Campaigns > Create a campaign > In-app/On-site.

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

On-site messages can be used as standalone campaigns or as part of multi-channel single stage campaigns.

To create standalone campaigns go to Campaigns > Create Campaign > In-App / On-site. Creating standalone campaigns allows you to use backend events as campaign triggers. For more information, see Set Triggers for In-App / On-site Campaigns.

To add On-site messages to single stage campaigns, go to Campaigns > Create campaign > Single-stage > Event triggered and then, select the On-site channel in the Setup tab of your campaign.

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 Triggers 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.