Tracking orders and purchases

This example outlines sending a purchase / order server side to the Seeka API, including the customer details and the products purchased.

Organisation ID and public key can be retrieved from the Seeka app. The public key is Seeka brand specific.

Considerations for software vendors: The organisation ID and public key provided in your request will linked to the Seeka brand you are sending data on behalf of.

Deduplication

The same order often reaches Seeka twice: once from the customer's browser when they complete checkout (via the Browser SDK) and once from your server (via the HTTP API). Seeka uses the activity ID to recognise both fires as the same order, so it is only counted once.

For deduplication to work, the server fire and the browser fire must carry the same value:

FireFieldWhere it is set
Server (HTTP API)activityIdpayload.activityId in the request body
Browser (Browser SDK)activityIdentifierOptions argument of the track method

Derive the value from the order itself, such as the order ID or order number. Both your server and your browser code can then produce the same value independently for the same order.

How Seeka matches the two fires:

  • The match key is the brand's public key, the activity name and the activity ID together. Both fires must be sent with the same X-Converge-Key and the same activity name, for example Order on both sides.
  • A key is remembered for 24 hours. A second fire with the same key inside that window is dropped as a duplicate; outside it, the event is counted again.
  • Server side fires are held for a few minutes before processing so that the browser fire, which carries the customer's browser context, is the one that is kept. You do not need to delay your own server side call.
  • The same rule applies to every activity you send from both sides, not only orders. If you also fire initiateCheckout server side, give it the same activityId / activityIdentifier pair.

activityId and activityIdentifier must be stable across the server and browser fires. Never use a random or time-generated value. If the two fires carry different values for the same order, Seeka cannot relate them and the order is counted twice.

Firing the same order in the Browser SDK, with activityIdentifier set to the same value as activityId in the HTTP request:

Converge.track.order({
  ....
 currencyCode: 'USD',
 totalTax: 87.1,
 totalShippingPrice: 12.10
}, {
  activityIdentifier: 'order_12345' // same value as activityId in the HTTP request
});

Specifying the event source

Software integrators sending events server side should include the src object to describe where the activity originally took place, so the event is classified and attributed correctly.

PropertyDescription
methodThe mechanism used to deliver the event. Use http when integrating with the HTTP API.
sessOptional string. Session ID where the order originated. Omit this field if the session ID is unavailable.
locURL of the page the order originated from, for example the event or product page the customer purchased on.
originMust be set to the constant value server when firing server side. This tells Seeka the event was fired from a server rather than a browser, so the request context of your server (IP address, user agent) is not treated as the customer's browser context.
timeISO formatted time the activity occurred. If omitted, the activity time from the payload is used, falling back to the time Seeka received the event.

To associate the order with its browser session, retrieve the session ID with Converge.identity.touchAndGetSessionId() in the browser and pass it to your server as src.sess. This field is optional and is not required to send an order.

Important: when firing server side, always set origin to the constant value server.

Sending an order to Seeka

The below tokens in the code example should be replaced with your own values.
TokenRequiredDescriptionExample
<organisation ID>YesYour organisation ID or the organisation ID of the Seeka organisation you are sending data on behalf of
<public key>YesYour public key or the public key of the Seeka brand you are sending data on behalf of
<activity ID>YesUnique identifier used to de-duplicate events, 6 to 128 characters. This should be the order ID or a unique identifier for the purchase.

See Deduplication below.
order_12345
<activity time>YesISO 8601 time the order was placed / created. Must not be more than 5 minutes in the future, otherwise the whole request is rejected with a 400 response.2025-02-24T14:15:22Z
<source URL>URL of the page the order originated from, for example the event or product page the customer purchased on.

See Specifying the event source below.
https://tickets.yourticketingplatform.com/event/summer-music-festival
<session ID>Session ID where the order originated. Optional: pass the browser session ID when available, or omit src.sess if unavailable.20250224.141522.1234567890
<seeka profile ID>Seeka profile ID retrieved from the browser SDK.

See retrieving the SeekaPId.

Highly recommended
sk.1.1709215400100.4182463348
<integration version>Version of your software build or the version of your integration.1.0.0
<integration name>Name of your software or the name of your integration. Use the same value your browser integration reports so browser and server traffic roll up under one source in Seeka. Do not add a channel suffix such as /server: server side delivery is identified by src.origin, not by the client type.ticketsaurus
<TCF consent>TCF v2.2 consent string for this activity, sent as src.privacy.tcfConsentString. When the brand's data control mode is implicit or explicit, Seeka uses it to decide which server side destinations may receive this activity.

To also update the consent stored on the customer's profile, send it as consent.privacy.tcfConsentString on the identity object (see pushing identities).
See privacy SDK for formatting and requirements
Node.js - AxiosNode.js - Axios
Node.js - FetchNode.js - Fetch
PHP - cURLPHP - cURL
C# - HttpClientC# - HttpClient
C# - RestSharpC# - RestSharp
Go - HTTP ClientGo - HTTP Client
const axios = require('axios');
async function sendOrderToSeeka(data) {
try {
// Headers
const headers = {
"Content-Type": "application/json",
"X-OrgId": "<organisation ID>",
"X-Converge-Key": "<public key>",
"X-Sdk-Client-Version": "<integration version>",
"X-Sdk-Client-Type": "<integration name>"
};
const response = await axios({
url: 'https://router.seeka.services/api/ingest',
method: 'POST',
data: data,
headers: headers
});
if(response.status !== 202) {
console.error('Unexpected response code when trying to send order to Seeka', response.status);
}
else {
console.log('Completed send order to Seeka');
}
}
catch (error) {
console.error('Error when attempting to send order to Seeka', error);
}
}
// Create order
const order = {
"data": [
{
"ev": {
"id": {
"seekaPId": "<seeka profile ID>",
"email": [
"jane.doe@gmail.com"
],
"phone": [
"+61422333444"
],
"firstName": [
"Jane"
],
"lastName": [
"Doe"
],
"address": [
{
"addressLine1": "Shop 6",
"addressLine2": "2500 Gold Coast Hwy",
"locality": "Mermaid Waters",
"state": "Queensland",
"stateCode": "QLD",
"postcode": "4218",
"country": "Australia",
"countryCode": "AU"
}
],
"dob": [
"1991-04-24"
]
},
"src": {
"method": "http",
"sess": "<session ID>",
"loc": "<source URL>",
"origin": "server",
"time": "<activity time>",
"privacy": {
"tcfConsentString": "<TCF consent>"
}
},
"payload": {
"activityName": "Order",
"activityId": "<activity ID>",
"commerce": {
"products": [
{
"currencyCode": "USD",
"productIdentifier": 12345,
"variantIdentifier": 1454854719669,
"sku": "AU5121",
"productName": "Long neck t-shirt",
"variantName": "Green",
"categoryName": "T-shirts",
"brandName": "Tees R US",
"unitPrice": 42,
"quantity": 2
}
],
"checkoutIdentifier": "3646074f511748b887f516b6267f8b9c",
"cartIdentifier": "00839db672e54c2caa154470522fca9e",
"orderIdentifier": "d20e83734528455ca9bc4d82c1ab9ae2",
"orderNumber": "4515222587",
"customerIdentifier": "eaf43d8985844fc499af9079a1ff2045",
"paymentMethodName": "Credit card",
"currencyCode": "USD",
"totalPrice": 84
},
"time": "<activity time>"
}
}
}
]
};
// Send order
await sendOrderToSeeka(order);

Batch sending orders to Seeka

Multiple orders can be tracked by providing a maximum of 20 events in the data array in the request payload body.