The SDK internal logic currently maps legacy names to new names to ensure backward compatibility. MoEngage recommends updating to the new syntax to maintain compatibility with future releases.
Global API mapping
Use the standardizedcamelCase naming conventions for all new implementations.
InitData Configurations
Old snake-cased
InitData properties are now deprecated. Warning messages will be logged in the console if they are used.| Legacy Property (Deprecated) | Standardized Property (New) |
|---|---|
project_id | projectId |
app_id | appId |
bots_list | botsList |
disable_onsite | disableOnsite |
disable_web_push | disableWebPush |
API Methods
Update your integration script and internal calls to use the following standardized methods:| Legacy Method (Deprecated) | Standardized Method (New) |
|---|---|
track_event | trackEvent |
track_page_view | trackPageView |
handle_page_change | handlePageChange |
call_web_push | callWebPush |
on_cards_loaded | onCardsLoaded |
add_user_attribute | setUserAttribute() |
add_first_name | setFirstName() |
add_last_name | setLastName() |
add_email | setEmailId() |
add_mobile | setMobileNumber() |
add_user_name | setUserName() |
add_gender | setGender() |
add_birthday | setBirthDate() |
update_unique_user_id | updateUniqueUserId |
destroy_session | logoutUser |
moe_events | moeEvents |
Note: Existing camel-cased or single-word methods like
track, identifyUser, and getUserIdentities remain unchanged.Impacted platforms
This transition affects all integrations that utilize the MoEngage Web SDK, including the following platforms and package managers:- Google Tag Manager (GTM)
- Shopify
- VTEX
- NPM/CDN
- Flutter Web
Integration scenarios
The migration path depends on your MoEngage SDK integration type. Identify your scenario below to determine the necessary actions.Fixed version
Critical: NewcamelCase methods are not available in legacy SDK versions. Do not refactor code until you update the SDK version in the source code to 2.71.00 and above.
New integrations
Implement the SDK usingcamelCase methods. This ensures the integration is natively compatible with modern JavaScript standards and prevents console warnings.
CDN/NPM
If the script tag pulls the latest version, the SDK automatically maps legacy calls to the new logic.Recommendation: To maintain a clean development environment and avoid deprecation warnings in the browser console, refactor these calls to
camelCase.Troubleshooting
To verify your SDK methods or identify any lingering legacy code, you can enable debug logging to view deprecation warnings directly in your browser’s console.-
Enable SDK logging: You must first call the following method to enable verbose logs for the MoEngage SDK. This must be executed before you can see the logs:
- Check the console logs: Open your browser’s developer tools and navigate to the Console tab. If any deprecated methods are still in use, the SDK outputs an error or warning message.