Skip to main content
This document outlines the new methods available in the MoEngage Personalize SDK to report impressions and clicks for API experiences created via the MoEngage Personalize API

Pre-Requisites

SDK Integration

  1. Refer to this article to integrate the Web SDK on your website.
  2. Refer to this article to integrate the Personalize SDK on your website.

MoEngage Account Configuration

Ensure your MoEngage workspace is enabled to utilize Personalize. Refer to this article for details on setting up a Personalize API experience.

Reporting Experience Shown events

The SDK provides a method to track experience shown events. To report an impression for an experience, use the below SDK method.
<script type="text/javascript">
MoEngage.personalize.trackImpression(experienceContext)
</script>
experienceContext is a JSON object that is returned in the Response to the Personalize API experience Fetch call. More details here

Reporting Experience Clicked events

The SDK provides a method to track experience clicked events. To report an click for an experience, use the below SDK method.
<script type="text/javascript">
MoEngage.personalize.trackClick(experienceContext,extraAttributes)
</script>
extraAttributes is a optional JSON object in which you can pass additional information about the link or the CTA which the user has interacted with.
{
  "button_id": "<submit-form-btn>",
  "button_name": "<Add to Cart>",
  "button_type": "<primary>",
}
The example JSON provided above illustrates sample values designed to give you a clear understanding of the types of data you can include when tracking additional information about clicks. Feel free to adapt these values to suit your specific implementation needs.