Disabling On-site Messaging
Optional step for On-Site messaging
disable_onsite: true on the pages wherever MoEngage Web SDK is active as described:
Callback to On-site messaging events
event.detail.name = 'MOE_ONSITE_MESSAGE_SHOWN'. Similarly, we provide callbacks to other On-site messaging events
| event.detail.name | description |
|---|---|
| MOE_ONSITE_MESSAGE_SHOWN | On-site message is shown to the user |
| MOE_ONSITE_MESSAGE_CLICKED | User clicks on the element on which moe-inapp-click class is present |
| MOE_ONSITE_MESSAGE_DISMISSED | User clicks on the element on which moe-inapp-close class is present |
| MOE_ONSITE_MESSAGE_AUTO_DISMISS | The On-site message is auto-closed after the time configured while creating the On-site messaging campaign |
event.detail.data when event.detail.name = 'MOE_ONSITE_MESSAGE_SHOWN'
event.detail.data of other On-site messaging events (eg: for MOE_ONSITE_MESSAGE_DISMISSED) will have similar (not identical) payload. You can check the data by logging it to the console: console.log(event.detail.data)
Troubleshooting
Sticky Banner type campaign is overlapping the website header.
Sticky banner type campaign hasfixed position with top: 0. So if your website also has any fixed position element with top: 0, then it will overlap. This is the tech limitation and should be handled by your end.
Solution:
You can update the position of you fixed position element as soon as the OSM template is displayed from Moengage. Use this:
On-site messaging campaign is not displayed.
Verify the following:- Check if the Trigger Action condition is matching or not
- If you have Selected Pages for onsite messaging, then check whether the URL is matching or not
- Check the segmentation of the Audience is matching or not.
- Check the platform (Web or Mobile Web) is appropriately selected.
On-site messaging test campaign is not working
Moengage Web SDK uses window.opener.postMessage to communicate between the Moengage dashboard and your website, in order to show the test OSM campaign. However, it may be that the window.opener is blocked between different origin in your website. Please check whetherCross-Origin-Opener-Policy': 'same-origin' header is added in your website.
If the above header exist in your website, then the test campaign will not work. You can either remove this and test or create a live campaign and target yourself using segmentation.
For further assistance, please contact your MoEngage Customer Success Manager (CSM) or the Support team.