Find: Track Add to Cart API
POST https://recs.richrelevance.com/rrserver/api/find/v1/track/addtocart/<API_KEY>? <Parameters>
This API records an add to cart event for a product featured in the search results and is used for Add to Cart conversion reporting.
This API should only be used when the item that is being added to the cart is the result of a search, usually when an add to cart button on the search result page is clicked to add the item to the cart. If no add to cart button is present on the search result page, retailers can opt to locally store the "addtoCartParams" value returned with the response so that when the shopper clicks on a product from the search result page and then adds to cart from the product description page, they can then send the "addtoCartParams" to the API to track the conversion.
The Find Response returns the addtoCartParams which contains part of the parameters that need to be sent in the Add to Cart API:
The other parameters like productId, userId, sessionId, rcs, etc. need to be added as you normally would
If the site also has Recommend and/or Discover implemented, for an Add to Cart click on the search result page, you will have the following tracking:
- Product click thru link provided by Find response for each product
- Add to cart API with the addtocart params + productId + additional parameters
- Add to cart recsForPlacements tracking - ONLY if Recommend and/or Discover is implemented.
Please refer to Add to Cart Page for the add to cart integration. Please refer to the Integration with Find section on that page.
|Name||Data Type||Required or Optional||Description|
The search term that was used.
|lang||String||Required||The language of the search. Examples: "en", "fr", "jp".|
|productId||String||Required||The product id of the item being added to the cart.|
|page||Number||Required||Page number where the product was displayed on the search result view.|
|searchConfigId||String||Required||Config id returned by the search api|
User ID. A unique string to identify each shopper (user). All shopper behavior is stored using this key. It is case-sensitive, and should be the same user ID sent to RichRelevance in other applications.
Identifies a single visit by a shopper. Sessions are used by behavioral models (to scope user behaviour in a shopping session) and reporting metrics.
|channelId||String||Optional||A channel is a description of the caller of this API. It's mostly used to describe whether this API is being used in an Android app or a Call center app.|
|rcs||String||Optional||First party cookie string. This is a encrypted value of richrelevance cookies. It should be passed as it was received in the earlier api response.|
|Returned when request is processed successfully|
|403 forbidden||Returned when find is not correctly setup for a site or the site api key is incorrect.|