Analytics
Analytics for Personalized Search can be captured on certain events, but how you capture them differs by event.
For a SearchClicks event, you must make an additional API call when you trigger the event. This directs the relevant analytics data to be captured.
For a Purchase event, certain data must be included on triggering the event. Analytics are then automatically captured.
When you trigger a SearchClicks event, you must make an API call to the following endpoint:
Pass the search click token with the call shown in the following example. Replace the sample token with your own.
The possible response codes are as follows:
- 200 Success.
- 400 Bad Request. Your request included a parameter that is unsupported.
- 500 Error. An unknown error has occurred. Please try again or contact your account manager for more information.
Purchase events are triggered by the addPurchaseRows method or by including monetate:context:Purchase in the Engine API request. When using Personalized Search, you must include both the productId and sku parameters in the call.
Personalized Search analytics are automatically captured when you use this call. You don't need to make any additional API calls.
Furthermore, to ensure that the purchase-related data, including sales generated through search, is reported and recorded correctly, you must establish some means of storing or maintaining the persistence of the value of a customer's monetateId. Refer to User Identity Persistence in Requests for more information.