Analytics & Reports

Trending products

Business Goal: I want to show trending products, to drive traffic into newest and most popular products.


These trending products will be drive by the order events - we will take the most popular ordered products within a specific category.

Their popularity will be driven by customer actions over the last 30 days, and can be further personalized by metadata such as gender, if you beacon that data in.

Sample Query

This will bring back top 4 trending products:

curl -H "Authorization: --clientKey--" \
    -XPOST "" \
    -d '{"type":"order", "size":"4", "target":"productId", "window":"week"}'

Sample response

This will return something like this:

  "status": {
    "code": 200,
    "message": "OK",
    "additionalInfo": null
  "result": [
      "productId": "99545475"
      "productId": "5498526"
      "productId": "261991-red"
      "productId": "2545199-white"
  "serverTimestamp": "2017-04-01T12:12:12+00:00"

To render these, you would use the Search API to query by productId against your product catalog:

curl -d '{ "query": "", "clientKey": "--clientKey--", "orFields": [ "productId"], "refinements": [ \
{"type": "Value", "navigationName": "productId", "value": "99545475" }, \
{"type": "Value", "navigationName": "productId", "value": "5498526" }, \
{"type": "Value", "navigationName": "productId", "value": "261991-red" }, \
{"type": "Value", "navigationName": "productId", "value": "2545199-white" } ] } }' ""

Optionally, you can then sort these by conversion (to show highest converting first).