SDK Support for Browser Extensions

This article describes how to use the MoEngage Web SDK inside your browser extensions. You can integrate the MoEngage Web SDK within your browser extension to collect analytics and track user events and attributes.



For now, we support only Google Chrome extensions.


MoEngage supports only the analytics channel in extensions for now. You can track events and attributes and user identities.


No additional permissions are required in your manifest.json when integrating the MoEngage SDK as a local file bundled with your extension.

Since the Google Chrome extension does not allow to fetch a script from an external URL, you must make a local copy of the script and place it in your project folder.

Getting Started



Before you get started, ensure that you have read the Initial SDK setup guide of Web SDK to learn more about our JavaScript integration in general.

To integrate MoEngage Web SDK, you will first need to download a copy of the latest JavaScript library. You can do this by downloading it directly from MoEngage CDN.

Find the CDN script based on your dashboard host. Right-click and download to save the file.

Dashboard Host CDN URL

After the download is complete, ensure that you copy the moe_webSdk.min.latest.js file somewhere into your extension’s directory.

Extension Pop-Up Windows

To add MoEngage SDK to an extension pop-up window, reference the local JavaScript file in your popup.html, as you would in a regular website.

<!-- Add the Moengage library-->
<script src="/relative/path/to/moe_webSdk.min.latest.js"></script>


After you add MoEngage SDK to an extension pop-up window, you can initialise the library as usual.

Because cookies are not supported in browser extensions, you can disable cookies by initialising with disableCookies: true.

window.Moengage = moe({ 
debug_logs: 0,
disableCookies: true

Refer the sample project for better understanding.



Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?