
When you make recommendation requests to the API, a `recommendation.generated` event is created automatically.

If you want to use [campaign statistics](/docs/ai-hub/recommendations-v2/recommendation-statistics) or build your own analyses and workflows, you must also send the following events:
- a `recommendation.view` event when the recommendation is displayed (shown on the screen or scrolled into view).
    - [Send with JS SDK](/developers/web/methods-reference#send-a-recommendationview-event)
    - [Send with Mobile SDK](/developers/mobile-sdk/event-tracking#recommendation-viewed)
    - [Send with API](#recommendationview)
- a `recommendation.click` event when a result is clicked or tapped.
    - [Send with JS SDK](/developers/web/methods-reference#send-a-recommendationclick-event)
    - [Send with Mobile SDK](/developers/mobile-sdk/event-tracking#recommendation-clicked)
    - [Send with API](#recommendationclick)

In these events, the `correlationId` parameter from the recommendation results and the `campaignId` parameter are used to correlate the events with a request and campaign that caused them. This can be used in Statistics, Decision Hub, and Automation Hub.
### recommendation.view
Send this event when the recommendation appears in the customer's view.

In the request, the `correlationId` must be the same as the `correlationId` from the recommendation response that was used to display the content.

For more details, see the [API Reference](https://developers.synerise.com/DataManagement/DataManagement.html#operation/publishAiCompatRecommendationViewUsingPOST).


If you have a [custom tracking domain](/developers/web/first-party-tracking) configured:
- Use the custom domain in the URL.
- [Add `/ai` before the endpoint path](/developers/web/first-party-tracking#updating-your-synerise-api-requests).




<pre><code class="language-plaintext">curl --location 'https://api.synerise.com/v4/events/ai-compat/recommendation.view?token=98A5FC55-0000-0000-0000-98339BDECAE6' \
--header 'Content-Type: application/json' \
--data '{
    "correlationId": "ac371d07-f8a2-4cae-9058-22e00b1f45b3",
    "clientUUID": "cf9e9b57-7776-51bc-b7bc-75cc75abdf59",
    "items": [
        "0196895673303",
        "0192309816199",
        "0196505285612"
    ],
    "campaignId": "DkhvrZoTKthD" // ADD THIS PARAMETER ONLY IN CAMPAIGN RESULT REQUESTS
}'</code></pre>


### recommendation.click

Send this event when an item from the recommendation is clicked or tapped, including buttons such as "Add to cart" or "Buy now".

In the request, the `correlationId` must be the same as the `correlationId` from the recommendation response that was used to display the content.

For more details, see the [API Reference](https://developers.synerise.com/DataManagement/DataManagement.html#operation/publishAiCompatRecommendationClickUsingPOST).


If you have a [custom tracking domain](/developers/web/first-party-tracking) configured:
- Use the custom domain in the URL.
- [Add `/ai` before the endpoint path](/developers/web/first-party-tracking#updating-your-synerise-api-requests).




<pre><code class="language-plaintext">curl --location 'https://api.synerise.com/v4/events/ai-compat/recommendation.click?token=98A5FC55-0000-0000-0000-98339BDECAE6' \
--header 'Content-Type: application/json' \
--data '{
    "correlationId": "ac371d07-f8a2-4cae-9058-22e00b1f45b3",
    "clientUUID": "cf9e9b57-7776-51bc-b7bc-75cc75abdf59",
    "item": "0196895673303",
    "campaignId": "DkhvrZoTKthD" // ADD THIS PARAMETER ONLY IN CAMPAIGN RESULT REQUESTS
}'</code></pre>
