(POST) Push Click Stats

This is an endpoint where you can send your analytics data to our server. If you want to see your metrics , like number of clicks, CTR, etc, to be displayed in our dashboard, you have to send the click data to this endpoint. When user clicks on one of the search result, you have to send both the session ID and the search ID.

POST#

https://api.altoshift.com/statsendpoint/stats

Header#

FieldTypeDescription
x-forwarded-forStringIP of the user

Request Header Example#

{
"x-forwarded-for": "125.160.114.239"
}

Request Body#

FieldTypeDescription
eventStringEvent's name
dataObjectEvent's data
    method optionalStringSearch method (strict, fuzzy, or soft)
    url optionalStringProduct url
    searchIdStringGenerated unique id of the search (every search action must have an unique id eventhough the user is the same)
    searchQueryStringSearch keyword that typed by the user
    searchCounter optionalStringNumber of search that user already did
    sessionIdStringSession id of the user
    tokenStringToken of the engine (token from the search layer)
    itemId optionalStringItem id that sent by our search result
    productIdStringUnique id of the products (product id from your site)
    titleStringThe name/title of product
    timeZoneStringTimezone of the user

Request Body Example#

{
"event": "click",
"data": {
"searchQuery":"wireless",
"token":"5cd3f3042cd48000372c64fd-1557394180073-88706995",
"productId":"58938",
"itemId":"5cd12285aecc14001c635614-5cd3f3042cd48000372c64fd-58938",
"method":"strict",
"timeZone":"Asia/Jakarta",
"sessionId":"eaaezz9k7-248153346jrglw123",
"searchCounter":"1",
"title":"LINK - WIRELESS ROUTER TL-WN8200ND_MD",
"url":"https://www.test.com/en/tplink-adapter-300mbps-tl-wn8200nd-tl-wn8200ndmd.html",
"searchId":"77dda021cf7329e20a33fa892d6cea54",
"userAgent":"Mozilla/5.0 (Linux; Android 8.1.0; Redmi Note 5 Build/OPM1.171019.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/68.0.3440.91 Mobile Safari/537.36 Instagram 77.0.0.20.113 Android (27/8.1.0; 440dpi; 1080x2030; Xiaomi/xiaomi; Redmi Note 5; whyred; qcom; in_ID; 139237670)"
}
}

Success 200#

FieldTypeDescription
successBooleanRequest was successful

Success Response Example#

{
"success": true
}