skip to Main Content

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

  1. using Persoo() js function to send an event
  2. using Data Layer push() function
  3. using REST API directly (without js client, which makes your life easier) … you will have to implement browserID generation and GDPR policies on the server side.

1. Through data layer (the recommended way)

Persoo works in a similar way like standard Google dataLayer, but requires different data to be sent.

Example:

 

If you push an event into the Data Layer:

Then it will be automatically sent to a Persoo server as a new event.

Persoo sends a default pageView event when it loads (this can be disabled for options below).

2. By manual event call

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 

 

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
Search