API Product Analytics
Extended explanation of API Product Analytics usage.
- API Product Analytics is a a new API data endpoint that accepts up to six parameters, and allows us to help you generate more revenue.
Please upload these information using this endpoint, v2/products/{product uuid}/visits.
Here you can view some of the example implementation
- productUrl - "string" Product url of the product on your website. *Required field
- environment - "string" Product url environment - live, staging, test, development. *Required field
- platform - "string" Product url platform - web, mobile, offline, others. *Required field
- userIp - "string" IP address of the user visiting the page
- userAgent - "string" Web browser user agent of the user visiting the page
- userLanguage - "string" Language display on the product page - using 2 character language code from ISO 639-1 Link
- You should implement this API endpoint at the following event
- During publication of the product (on mobile or web) - when publishing the product on your platform, make a request to the api and pass these THREE required parameters: "productUrl", "environment" and "platform"
- Product detail page - if possible, beside the two required parameters, "productUrl" and "environment", pass in the additional 4 optional parameters
- Example on Product Page Web Analytic API demo
product UUID: d3bfa3e1-edd4-5c24-a051-4d6c56aae621
API Url: v2/products/d3bfa3e1-edd4-5c24-a051-4d6c56aae621/visits
HTTP method: POST
Example of Request body
{
"productUrl": "http://mydomain.com/d3bfa3e1-edd4-5c24-a051-4d6c56aae621/view",
"environment": "live",
"platform": "web",
"userIp": "192.168.1.1",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) ",
"userLanguage": "en"
}
Response
{
"code": 200,
"message": "Submission successful.",
"timestamp": "2019-02-15T12:24:26.009+08:00"
}