To send events securely from your backend, you’ll need to generate an API secret. This secret is unique to your website and must never be exposed on the client-side. It should only be used on trusted backend servers.
⚠️ Important:
Keep your secret private. Never include it in frontend code, public repos, or untrusted environments.
Sales events (win_...
) should always be sent from your backend. Use the API endpoint below (replace with the endpoint once available).
POST <YOUR_API_ENDPOINT> Headers: { "Authorization": "Bearer YOUR_SECRET_KEY", "Content-Type": "application/json" } Request Body: { "eventType": "win_sale", // e.g. win_sale, win_purchase, win_order "websiteId": "68ab108c4a215929683ad3b9", "data": { "saleAmount": 100, "saleId": "123456", "saleCurrency": "USD" } }
Custom events (custom_...
) allow you to track specific user actions such as logins, checkout steps, or interactions. These can be sent from either backend or frontend, but make sure to pass the required identifiers.
POST <YOUR_API_ENDPOINT> Headers: { "Authorization": "Bearer YOUR_SECRET_KEY", "Content-Type": "application/json" } Request Body: { "eventType": "custom_login", // e.g. custom_login, custom_payment_intent "visitorId": "<extract from __visitorId cookie>", "sessionId": "<extract from __sessionId cookie>", "websiteId": "68ab108c4a215929683ad3b9", "data": {} }
Tip:
Use custom_...
events liberally to segment and analyze user flows. Combine them with predefined events for a full picture of user behavior.
Copyright © 2025 - All rights reserved