Collect

Datasources Collector

The collector is the component responsible for receiving data from outside Reelevant. Alternatively to the datasources in the "worker" mode, datasources using the "ingester" mode can only store data that are coming through this endpoint.
The only datasource type that you can use right now with this endpoint is the "Website Events" one.

📘

Even though we mention website events here, you can send events from any platform (mobile/desktop app for example) as long as its formatted correctly.

To push events, you must the the /collect/{id}/rlvt where {id} is the datasource id (that either the support team can provide or alternatively you can just check it inside the datahub app. The schema is the following:

PropertyTypeDescription
keystringThe company id (ex: 61a095fdd8d2e20011544831)
tmpIdstringrandom identifier that is persisted in the device (for website inside cookie rlvt_tmpId) for a specific period (ex: ckz2qlmkm00002y8pa227wee9)
eventIdstringrandom identifier to identify a specific event (ex: ckz89g21600002y91xx7eaj56)
namestringname of the event (ex: product_page)
urlstringthe current url, please remove the queries parameters or hash.
uastringthe current user agent of the device
dataRecord<string, unknown>See afterwards for a complete description
clientIdIdentifier of the user performing the action that triggered the event. This specially important since this will be used when finding back what a specific user have seen.
vnumber (1)protocol version, please always set this to 1
bstringOpaque string given when user is redirect to the platform by a reelevant workflow (it contains encrypted metadata)
idstringOpaque string given when user is redirect to the platform by a reelevant workflow (it contains encrypted metadata)
timestampnumberthe unix timestamp at which the action has been performed. By default its set the when our backend receive the event but you can set a specific one (for example if you failed to push the event and you need to retry it later)

The data property is a dictionary that you can refer it as "labels". There are specific (and so reserved) label that have special behavior.

Label nameLabel typeLabel description
idsstring[]A list of ids that identify the item if the event relates to a item being bought/seen/like etc (ex: for a purchase this need to contains all product identifiers bought)
transIdstringIf the event relates to a transaction/order, please include the identifier of the said transaction .
valuenumberA value representing the monetary value if the event is related to something that you can buy (ex: for a purchase event we'll indicate the price of the product that have been bought)
any other labelstringAny labels that need to be attached the the event (ex: for a multi langual website, you may add a label with the local to be able to filter it later).
Some label have specific meaning: