Loading your account…

Brand Integration Docs

Track sales accurately by sending sale events to Analytx after creating campaigns and assigning products.

Overview

Analytx allows brands to track sales from creators and campaigns. To ensure accurate tracking and security, sale events must be sent from your backend, never directly from the frontend.

Each creator receives a referral link with a referral code, for example:

https://yourbrand.com/product-page?ref=CREATOR123

Your backend should capture the referralCode and send verified sale events to Analytx securely.

Authentication

Analytx uses a custom API key header for authentication.

Include your API key using the following request header:

x-analytx-api-key: YOUR_API_KEY_HERE

Replace YOUR_API_KEY_HERE with the API key generated in your brand dashboard.

Do not use the Authorization header. Requests using Authorization will be rejected.

Sending a Sale Event

To record a sale, your backend must send a POST request to:

POST https://tryanalytx.com/api/event/sale

Required request body fields:

  • referralCode – The creator’s referral code captured from the URL.
  • skuId – SKU of the sold product (must belong to the campaign).
  • salePrice – Final sale amount used for commission calculation.

Example request:

POST https://tryanalytx.com/api/event/sale
Headers:
  x-analytx-api-key: YOUR_API_KEY_HERE
  Content-Type: application/json

Body:
{
  "referralCode": "CREATOR123",
  "skuId": "SKU-001",
  "salePrice": 499
}

On success, the API responds with "Sale recorded". Invalid API keys, referral codes, or SKUs will return an error.

Recommended Flow

1. Creator shares a referral link: https://yourbrand.com?ref=REFERRAL_CODE

2. Frontend captures the referralCode during checkout.

3. Backend validates the purchase and sends the sale event to Analytx.

4. Analytx tracks attribution, commissions, and analytics in real time.

Notes & Best Practices

  • Always send events from your backend.
  • Never expose your API key in frontend code.
  • Use custom headers only; avoid Authorization.
  • Send sale events immediately after successful payment.
  • Ensure products and referral codes belong to active campaigns.

For support, contact jems.analytx@gmail.com