This section describes the integration of Web SDK on your website to track web user attributes and events. In case you are looking for Chrome/Firefox Push integration, proceed directly to the step-by-step integration flow.
Include the below mentioned MoEngage Web SDK script inside the <head> tag of your website.
YOUR_APP_ID_GOES_HERE - Replace this with your account APP ID (find your APP ID on MoEngage Dashboard -> Settings -> App Settings)
debug_logs: 1 - This will enable you to see test data in TEST environment - accessed via clicking on toggle button in top bar on Dashboard. Read more about TEST/LIVE environment here
Note: In case you are using Google Tag Manager, you can refer to this section.
Before taking your website LIVE
In case you are taking your website live, DO ENSURE you pass debug_logs: 0 parameter to see Live data in LIVE environment on Dashboard otherwise your Live users will see an alert about the Test environment
You can also place the above SDK script and SDK initialization as a Custom HTML Tag inside GTM. This Tag can be fired once per page and fired on the pages where you wish to track web events/attributes.
You can next proceed to Tracking Website Events. This will help you to send segmented notifications/emails to avoid spamming and target only relevant users who did an event or share a common attribute (such as location).
|Tracking Website Events|