Releva has completed an $870,000 financial round led by New Vision Fund 3 with participation by HR Capital AD, Verto Invest and the investment arm of private investors.
Releva завърши финансов рунд от $870 000, воден от Фонд Ню Вижън 3 с участието на Ейч Ар Капитал АД, Верто Инвест и подкрепата на частни инвеститори.
Search the Documentations
Categories

Send Custom Events using Releva.push()

If you would like to send custom events from the frontend integration for your users (e.g. add to wishlist, add to product compare, etc.), this is the way to do it.

The benefit of using the frontend integration as oppsoed to the Custom Event API is that it’s easier to implement, and it works for anonumous users.

In order to send custom events, you need to call Releva.push as usual, and also add the events array:

Releva.push(<accessToken>, {
  page: {...},
  profile: {...},
  cart: {...},
  events: [
    {
      tags: ['foo', 'bar'],
      action: 'surveyInteraction',
      timestamp: '2021-02-09T09:12:17.317Z',
      products: [
        {id: '123'},
        {id: '234'}
      ],
      custom: {
        string: [
          {
            key: 'q1',
            values: [
              'answer1'
            ]
          },
          {
            key: 'q2',
            values: [
              'answer2'
            ]
          }
        ]
      }
    }
  ]
}, cb, errorCb, opts);

The events Array

This object is an array of Objects with the following properties.

FieldTypeDescription
tagsArray[String] (Optional)The tags associated with this event. You can use this data to build segments and trigger campaigns based on custom events.
actionStringThe name of the action which this event refers to. You can use this data to build segments and trigger campaigns based on custom events.
products[].idString (Optional)Products identifiers associated with this event.
timestampISO-8601 String (Optional)The date and time when this event happened.
customObject (Optional)The custom fields associated with the event.

Response Format

A successful response contains the standard push response as shown in the Frontend Integration Guide.

An error response will return a HTTP 4xx or 5xx status code and have the following structure:

{
  "message": "A description of the error and how to fix it, if it's a client error."
}
Previous Search Event API
Next Get Events
Table of Contents