Authentication & API Usage

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.

Generating Your Secret

  1. Log into the LinkBridge dashboard.
  2. Navigate to Website Settings.
  3. Click on Generate Secret (for first time use) or Reset Secret (if needed).
  4. Store the secret securely (e.g., environment variable).

Sending Sales Events (win_...)

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"
  }
}

Sending Custom Events (custom_...)

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": {}
}

Copyright © 2025 - All rights reserved