Skip to main content
Mandatory step for Web Personalization
Web Personalization is used to personalize the website experience for each user. A few popular use cases for Web Personalization include the home page banner personalization basis user behavior, localizing the website content basis user geography, testing the performance of new page layouts for improved performance, and modifying the content shown on any webpage as per the user behavior. Contact your customer success manager (CSM) or the MoEngage Support team to get Web Personalization enabled for your account. After Web Personalization is enabled for your account, update the MoEngage web SDK initialization script on your website.  For more information, refer to Web SDK Integration. While using MoEngage web personalization, there are two integration options available. Selecting one of these options depends upon when you want MoEngage to trigger the personalized campaign data to the website.
  • Trigger Action: Custom Event - You can create campaigns that are triggered on custom events that are being tracked from the website. Once the trigger event is performed by the user, the data will be fetched by MoEngage automatically. You can then consume this data as required.
  • Trigger Action: Self Handled - You can also create campaigns that are triggered when required without an associated event trigger.
For more information, refer to Create Web Personalization Campaign.

Trigger Action: Custom Event

To fetch the personalized campaign data automatically from MoEngage when your users perform an event, select the trigger action as Page load or as a custom event and then select an event. This setup is done in Step 1 of the Web Personalization campaign creation. Please note that the custom event should be tracked on the website. Else the campaign will not be triggered.
Trigger Action Custom Event
The following code enables you to integrate the personalized web campaign:  
 
CriticalEnsure that code is just after the SDK script.Do not confuse it to be a function that you can call after any custom event to get the payload data.
For more information about the MoEngage sample code, refer to the sample code.

Trigger Action: Self Handled

Use this option to define when to fetch the personalized campaign data from MoEngage instead of when the user performs an event. You need to select the trigger action as “Self Handled” in this case. This does not need any event to be tracked by you, as you can directly call the MoEngage function to fetch data when required.
Trigger Action Self Handledled
The following code enables you to integrate the personalized web campaign: