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 upon triggering the event. Analytics are then automatically captured.
When you trigger a SearchClicks event, you must make an API call to the following endpoint:
Replace {channel_name}, {channel_instance}, and {channel_domain} with your channel data.
Pass your search click token with this call. The JSON below depicts an example of what to pass. Replace the sample token with your own token.
After you make a call, Monetate returns a response code. This code can vary based on your request. Use the following definitions to help you diagnose failures, invalid requests, errors, and successes:
- 200 (Success): Indicates a success, and returns the passed information.
- 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. When using personalized search, both the productId and sku parameters are required.
Personalized search analytics are automatically captured when using this call. You do not need to make any additional API calls.