Skip to main content
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 standardized camelCase 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_idprojectId
app_idappId
bots_listbotsList
disable_onsitedisableOnsite
disable_web_pushdisableWebPush

API Methods

Update your integration script and internal calls to use the following standardized methods:
Legacy Method (Deprecated)Standardized Method (New)
track_eventtrackEvent
track_page_viewtrackPageView
handle_page_changehandlePageChange
call_web_pushcallWebPush
on_cards_loadedonCardsLoaded
add_user_attributesetUserAttribute()
add_first_namesetFirstName()
add_last_namesetLastName()
add_emailsetEmailId()
add_mobilesetMobileNumber()
add_user_namesetUserName()
add_gendersetGender()
add_birthdaysetBirthDate()
update_unique_user_idupdateUniqueUserId
destroy_sessionlogoutUser
moe_eventsmoeEvents
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: New camelCase 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 using camelCase 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.
  1. 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:
    Moengage.setDebugLevel(2)
    
  2. 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.
Example: [“destroy_session” is deprecated. Please use “logoutUser” instead.]