Report a banner, story or page engagement event
- Path
/push/events/{accessToken}- Auth
- Access token · in the URL path
const url = 'https://releva.ai/api/v0/push/events/YOUR_ACCESS_TOKEN';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"deviceId":"demo-device-pb-1","sessionId":"demo-session-pb-1","action":"bannerClick","attributions":{"bannerBlockId":"7e5c8e4b-1f2d-4c3a-9b8e-2a1d3f4e5c6b","bannerId":"1"},"page":{"url":"https://demo-store.example.com/"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://releva.ai/api/v0/push/events/YOUR_ACCESS_TOKEN \ --header 'Content-Type: application/json' \ --data '{ "deviceId": "demo-device-pb-1", "sessionId": "demo-session-pb-1", "action": "bannerClick", "attributions": { "bannerBlockId": "7e5c8e4b-1f2d-4c3a-9b8e-2a1d3f4e5c6b", "bannerId": "1" }, "page": { "url": "https://demo-store.example.com/" } }'Records one storefront event per request: a banner click or close, a story event, or page engagement (scroll
depth and active time). The JavaScript SDK and the mobile SDKs call it for the blocks they draw; call it
yourself only for banners and stories you render from the push response. Send the access token in the path,
or as authorization: Bearer <accessToken> on POST /push/events.
bannerClick and bannerClose with attributions.bannerId set the banner’s Show until click memory for
the device; bannerClick also attributes later cart adds and orders to the banner block, and is
de-duplicated with the click Releva detects when the visitor lands on an rlv_bid link. storySlideClick and
storyClose with attributions.storyId mark the story as seen for the device, and storySlideClick also
attributes later cart adds and orders to the story. A pageEngagement event with
activeTimeMs under 1000, or on a page that is not a Releva page, answers 202 and is not stored.
The JavaScript SDK sends the same body as a form field formPayload, like the page push.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The shop’s access token.
Example
YOUR_ACCESS_TOKENRequest Bodyrequired
Section titled “Request Bodyrequired”object
The visitor’s device id, the same value as context.deviceId on the push. One of deviceId or profileId
must be non-empty.
The visitor’s session id.
bannerClick, bannerClose, storyImpression, storySlideView, storySlideClick, storyComplete,
storyClose or pageEngagement. Any other string is stored as an event of that name.
The known profile id
object
The banner block token from the push response.
The bannerId from the push response
The story token from the push response.
object
For pageEngagement.
For pageEngagement. Under 1000 is not stored.
The browser’s A/B test bucket (the SDK’s rlv_g cookie). An empty string or null counts as absent.
Example
{ "deviceId": "demo-device-pb-1", "sessionId": "demo-session-pb-1", "action": "bannerClick", "attributions": { "bannerBlockId": "7e5c8e4b-1f2d-4c3a-9b8e-2a1d3f4e5c6b", "bannerId": "1" }, "page": { "url": "https://demo-store.example.com/" }}Responses
Section titled “Responses”Accepted. The event is stored asynchronously.
object
Example
{}Authentication or validation error.
object
Human-readable error. Several validation errors are joined with a space.
Examples
{ "message": "The access token you provided is invalid."}{ "message": "The 'deviceId' field is required. The 'sessionId' field is required."}{ "message": "One of profileId or deviceId is required."}{ "message": "The 'action' field must be a string."}{ "message": "formPayload is missing from request body"}The domain is disabled.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "Domain is disabled. Please reach out to support@releva.ai to enable it."}Unexpected server error.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "An internal error occurred."}