How do I setup Spotler Activate on a Single page application (SPA)?

Do you have a single page application - a website where you don't load every page with a classic page refresh in your browser? Then you also need, next to the default setup, to implement this event: ReloadPersonalization.

This event is triggered when you want Spotler Activate to perform a new check for loading personalizations (or not). A practical reason for this is often in single page applications, because Spotler Activate needs a classic pagerefresh by default. This ensures that personalisations function like a standard setup.

The ReloadPersonalization event looks like this:

 <script type="text/javascript">
window._sqzl = window._sqzl || [];
window._sqzl.push({
"event" : "ReloadPersonalization"
});
</script>

The ReloadPersonalization event needs to be implemented manually. In a single page application it is triggered at each page load, probably in combination with the pageview event. You can also fire it custom depending on your setup.

Product trigger event? Send the Reload event right before your Viewcontent event (or any event with a product array).

Reload audiences and product sets (datalayer events)

By default, Spotler Activate sends various datalayer events with data generated by us once per page load. This way, you can address them independently without using personalizations. These are:

  • sqzl_customer_audiences (summary of all audiences the user is a member of)
  • sqzl_productset (1 event per product set; select the desired sets in your merchant settings)
  • sqzly_Spotler ActivateAudience (same data as customer_audiences event, but in our Ads syntax)

When using a SPA, this will not happen by default unless the page is hard loaded. To compensate for this, you can send this event:

sqzlTransmit.loadDataLayer();

We send the above events as if they were a new page load.