skip to Main Content

There are 3 ways how to collect events to Persoo. We recommend to use dataLayer.

  1. using persoo js function to send an event
  2. using dataLayer push
  3. using REST API directly (without js client, which makes your life easier) … you will have to implement browserIDs and GDPR policies yourself.

1. By calling a javascript function:

For example clicking on “Add to basket” button should call an event such as this:
Each pre-defined event is processed in a different way. It generally reports the visitor’s behavior and returns data needed for rendering personalizations. Or it can directly call Persoo functions realizing content rendering. There is an optional callback parameter, that is called with an argument “data” (see below).

If the data is prepared in one or more objects, you can send them as follows:

Where the data from variables “data” and “data2” are merged together.

Note! Event for measuring statistics (called “statistics”) reports impressions only for Offers that are visible. That means the impression will not be sent if the offer:
– Is not visible on the screen,
– Is hidden below the fold,
– has no content,
– has CSS display:none or visibility:hidden
– or has zero height 

2. Through data layer (recommended way)

Persoo shares the dataLayer with Google tools (in the same format), which brings considerable advantages:

  • You don’t need multiple data layers in the page
  • If you set up advanced event tracking, e.g. Enhanced E-commerce, then all the data can be used by both Google Analytics and Persoo. This unified measurement will ensure the same events in both tools.
  • If an event occurs, that changes the content through AJAX, Persoo will learn about this interaction and can react (render personalization, increase interest score etc.)
If you push an event into the dataLayer:
Then it will be automatically sent to a Persoo server.

3. Through REST API

If you don’t want to use a JS client (e.g. to avoid CORS problems), you can make your request through RTP API.

Note: but do not use it for all events/pageviews reporting, otherwise you will have to develop your self all the things related to BrowserID cookies, profile data collection levels, et.c

Learn more about persoo.js client methods.

Back To Top
×Close search