Analytics & Reports
Analytics
StoreFront

Trending products

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

Personalization

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
curl -H "Authorization: --clientKey--" \
    -XPOST "https://--customerId--.groupbycloud.com/wisdom/v2/recommendations/products/_getTrending" \
    -d '{"type":"order", "size":"4", "target":"productId", "window":"week"}'

Sample response

This will return something like this:

json
{
  "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
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" } ] } }' "https://--customerId--.groupbycloud.com/api/v1/search"

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