The following fields are common to all request types.
|Name||Description and usage|
|type||Type of request – Determines the format of the message. It should be one of the following:
|ip||[Optional] – IP address of the site visitor
If specified, you can use the IP address for a geolocation lookup to identify the approximate location of the visitor for a personalized online experience for Promote. The IP address is not stored.
|session||ID of the Optimizely session established with the tracker – Use new if no session was established with Optimizely yet – Returns the allocated session on a successful response. Use that session ID for subsequent requests for this cuid and session – Sessions should expire after a period of user inactivity (such as four hours), so any requests after this period should revert to new.|
|cuid||Consolidated user ID – Use new if the cuid is unknown – Returns the cuid value on a successful response. Store the cuid in persistent storage and send it back in future requests so you can track the same customer across multiple sessions.
Note: Use the same cuid for subsequent requests related to the same user/device.
|site||Site code of the Optimizely customer – Identifies the retailer's site with the site code provided by Optimizely.|
|clientToken||Authentication token for the Optimizely customer; a token provided to the Optimizely customer that must be included as part of the JSON data in every API call – A separate clientToken is issued for each channel – Ensure that you are using the correct token for your channel.
Note: Any clientToken provided by Optimizely to access the RESTful service hosted on Optimizely's UAT server is different from the one provided for the service on Optimizely's live server. Make sure you are using the appropriate clientToken.
|channel||[Optional] – Access channel. It should be one of the following:
|currentURI||Site visitor's current URI – For example, for web customers, this is the current URI (uniform resource identifier).|
|previousURI||Previous URI of the site visitor before the current one – For example, for web customers, this is the referrer header.|
|user||[Optional] – For example:
Note: When you provide user, also supply id. Use id instead because name and email are deprecated and kept for backward compatibility.
|userAgent||User-Agent string – Information about the site visitor’s browser and operating system – Mandatory from v1.3 of the Server-to-Server API.|
|abTestContent||[Optional] – Controls how much A/B test information to return in the response data – Available values are:
|recContent||[Optional] – Recommendation content configuration for Recommendations – Available values:
|smartProducts||[Optional] – Only applicable if you are using multiple Optimizely products on a page. It overrides the configuration for a page, letting you switch off the generation of Optimizely products for this request – If smartProducts is not defined, the content for all Optimizely products defined for the page is returned as normal – An array of strings listing the Optimizely products to include in the response for this page. Available values are smartRecs for Recommendations and smartContent for Promote – For example, if Recommendations and Promote are configured for a page, but you only want results returned for Promote and not Recommendations, then include the smartProducts property in the request as follows:
To return no Optimizely product information on a page, use smartProducts as follows:
|info||[Optional] – Variable metadata information about clicks, A/B test information, and so on. See Click tracking and A/B testing.|
|customAttributes||[Optional] – Allows real-time filtering of recommendations based on the specified custom attributes – A comma-separated list of attribute names and values. Attribute names must contain no spaces.
Custom attributes are used only in real-time; they are not stored in the system.
|customer||[Optional] – Used for B2B customers, customer is an all-encompassing object in the tracking model that contains information based on a client's customer.
Updated 7 months ago