Skip to content

Tracking

TR01 - Tracking of displayed pages and clicks

Request

Description

This endpoint is used for tracking displayed pages and clicks.

Headers
User-Agentstring

The user agent from the browser of the end user. If the call is made on a backend side, please copy the user-agent coming from the browser so that Target2Sell can detect the device correctly.

Bodyapplication/x-www-form-urlencoded
adIdstring

This parameter is needed and mandatory for the click, impression and viewableImpression events. The adId is provided by the Mirakl Ads recommendations in the AdServer response.

anystring

anything from the website's query string is transmitted as parameter

basketAmountinteger, (int32)

total amount of the cart (VAT included). Mandatory on a « Cart page », « Post purchase page »

categoryIdinteger, (int32)

category id: id of the main category of a product list. Mandatory on a « Category page »

domainstring

is Mandatory if the beginning of your website URL changes in fonction of your pages (i.e : www.mywebsite.com becomes product456.mywebsite.com when visiting the product 456 page)

eventNamestring

Event type. Possible values: view, click, impression, viewableImpression

keywordsstring

keywords from search Mandatory on a « Search result page »

offerIdstring

Only for 3P products in the order, mandatory on « Post purchase page ».

Example:"productId1:offerId1|productId2:offerId2|productId3:offerId3"
orderIdstring

order ID: unique identifier of the order placed by the visitor. Mandatory on a « Post purchase page »

pageIdinteger, (int32)required

page Id Unique identifier of the page.

Enum: "1000", "1200", "1400", "1600", "2000", "2400", "3400", "4000"

priceListstring

price list: formatted list of the amount of each bought products. Each amount has to be separated from the next one by "|", and equals the price of each product multiplied by the quantity. This parameter is necessary in case of discount (in B2B mainly). Mandatory on « Post purchase page »

productIdstring

item id. List of products on the page. Each one of them should be separated by « | ».Mandatory on a « Product page », « Cart page », « Add-to-cart », « Search result page », « Post purchase page »

Example:"p456|p76|p890|p56"
productsQuantitystring

formatted list of the quantity of each product in the cart. Each identifier has to be separated from the next one by "|" Mandatory on a « Cart page », « Post purchase page »

publisherIdstringrequired

publisher Id

refererstring

The previous web page. Used to understand the tracked user's behavior.

Example:"https://www.website.com/refering-url"
urlstring

The current web page. Used to understand the tracked user's behavior.

Example:"https://www.website.com/current-url"
userIdstring(^$)|(^\p{XDigit}{8}-\p{XDigit}{4}-\p{XDigit}...

Session Id. Value of the target2sell session cookie, Can be found in cookie «t2s-p» if you are using the Target2Sell JavaScript. Otherwise, the default pattern expected for this ID is (in Java) "^\p{XDigit}{8}-\p{XDigit}{4}-\p{XDigit}{4}-\p{XDigit}{4}-\p{XDigit}{12}$"

Example:"123e4567-e89b-12d3-a456-426614174000"
userKeystring

User identifier. This parameter is not mandatory but it is very important to fill in when the user's identifier is known (user logged in). Use the user's own unique identifier — it should not be a cleartext email address. UUID and hashed formats (SHA-256, SHA-384, SHA-1, MD5) are supported natively; contact support to enable other formats.

curl -i -X POST \
  https://t.eu1.mirakl.net/1.1/json/T/t \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'User-Agent: string' \
  -d '{
  "publisherId": "HJGEL5S1F3GCE4",
  "pageId": "1200",
  "userKey": "84kofe43a5g165e4609d3925bb565d53fc161874c8ee998ba16d64914d88dfee",
  "userId": "ee3dj7zd-5b0e-4362-d9a4-25535731376a",
  "eventName": "view",
  "productId": "2237310185",
  "url": "https://www.url.com",
  "referer": "https://www.website.com/refering-url",
  "offerId": "c5372892-fea3-4c09-b7d0-e796c6088b92"
}
'

Responses

OK

Bodyapplication/json
abDateinteger, (int32)

Last A/B date

Example:1111111111
abDisplayboolean

A/B value for the visit

Response
{ "abDate": 1111111111, "abDisplay": true }