HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityLog In

Migrating Server-to-server API 1.2 to 1.3

This topic describes changes between for version 1.3 of the Server-to-Server API, used for personalization features in Optimizely.

Tracking Response

The API response will always contain the pageTrackingId parameter.

You can use this information when tracking on page dynamic searches or Personalized Search & Navigation (formerly Find) requests.

See the Personalized Search & Navigation API document for how to track on page dynamic searches.

userAgent

The userAgent parameter becomes mandatory in the tracking request.

Variant Tracking

You can track product variants on the Basket page , Order page and Checkout page pages.

Search results tracking request

The request payload for search tracking, in particular the searchResults section, has changed to track more accurate information.

Payload for v1.2:

{ 
      "type"          : "searchresults",
      "ip"            : "10.42.37.139",
      "session"       : "155780550/hKugo5RQsqecUpmlWE6EpFWqmalVrJU",
      "cuid"          : "143159800/hKugo5RQsqecUpmlWE6Eo1OklrJYp5U",
      "site"          : "retailer",
      "clientToken"   : "1234abcd5678",
      "channel"       : "web",
      "lang"          : "en-gb",
      "currentURI"    : "www.retailer.com/search.html?term=bags",
      "previousURI"   : "www.retailer.com/home.html",
      "searchResults" : { 
                          "term" : "bags", 
                          "results" : [ 
                                        {"refCode" : "RC1"},
                                        {"refCode" : "RC2"} 
                                      ] 
                        } 
    }

Payload for v1.3:

{
      "type"          : "searchresults",
      "ip"            : "10.42.37.139",
      "session"       : "155780550/hKugo5RQsqecUpmlWE6EpFWqmalVrJU",
      "cuid"          : "143159800/hKugo5RQsqecUpmlWE6Eo1OklrJYp5U", 
      "site"          : "retailer", 
      "clientToken"   : "1234abcd5678", 
      "channel"       : "web", 
      "lang"          : "en-gb", 
      "currentURI"    : "www.retailer.com/search.html?term=bags", 
      "previousURI"   : "www.retailer.com/home. html", 
      "userAgent"     : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36", 
      "searchResults" : { 
                          "term"                        : "bags", 
                          "personalisationAttributesId" : "abcd1234", 
                          "totalNumberOfResults"        : 50, 
                          "pageNumber"                  : 1, 
                          "resultsOnPage"               : 18, 
                          "filters"                     : [{ 
                                                            "filter"   : "colour", 
                                                            "operator" : "IN", 
                                                            "values"   : ["red","orange","yellow"] 
                                                           }, 
                                                           { 
                                                            "filter"   : "price", 
                                                            "operator" : "BW", 
                                                            "values"   : ["0","50"] 
                                                           }, 
                                                           { 
                                                            "filter"   : "size", 
                                                            "operator" : "IN", 
                                                            "values"   : ["XS","S"] 
                                                          }], 
                          "topResults"                  : [ 
                                                            {"refCode" : "RC1"}, 
                                                            {"refCode" : "RC2"}, 
                                                            {"refCode" : "RC3"} 
                                                          ] 
                        } 
    }

Did this page help you?