Integration
library_add_check |
Prerequisites
|
Scope
Context | Support status |
---|---|
Sync standard salesforce entities such as Contacts, Leads, Accounts, Opportunities, etc to MoEngage as users or events | Supported |
Sync custom salesforce objects to MoEngage as users or events | Supported |
Support for all standard salesforce fields- String, DateTime, Numeric, Formula fields, Object types (such as Salesforce standard geo location field object) | Supported |
Send historical data sync to MoEngage | Supported |
Real time data sync on new record creation or record updates | Supported |
Create new attributes on MoEngage while setting up the data sync | Supported |
Sync linked entities (relationships between entities) to MoEngage |
Not supported In the current scope, we sync only the IDs of the linked fields. The whole linked object is not synced. |
Steps
The integration is divided into two major steps
- Connections- Connections is the authorisation to your MoEngage workspace. You can connect multiple MoEngage workspace to a single Salesforce instance.
- Syncs - Sync is job that runs in real time to send the specific data between the two system. It includes your sync type (MoEngage to Salesforce or Salesforce to MoEngage), entities to be synced and data mapping.
Other minor sections include Error logs and Exceptions - this is particularly important to debug incase the data sync is not working.
Click on “App launcher”, enter “MoEngage”, and then select “MoEngage App”.
Step 1: Setup a connection
- Click Connections >> Add New Connection
- Enter your MoEngage workspace details
Field name | Value |
---|---|
Connection Name | You can give any name to your connection - eg. "MoEngage Prod" or MoEngage Workspace |
Workspace ID | The Workspace ID of your MoEngage account is available in Settings -> App Settings -> APIs >> Workspace ID |
Data Key | The Data ID of your MoEngage account is available in Settings -> App Settings -> APIs >> Data key |
MoEngage Data center | This is your MoEngage data center. Read more |
3. Click Save.
Step 2: Setup a sync
For this document, we will focus on this example - Sync Salesforce Contacts to MoEngage as Users. You can follow the similar process for event sync.
Sync Salesforce Contacts to MoEngage as Users
- Click Map Fields.
- Click Add new sync
- Enter basic sync details
- Click Next
- Configure data mapping between the two systems
- Define the identifier between the two systems. For MoEngage, identifier name is Customer ID. But it can be mapped to any field from the Contact object.
- Setup mappings for other fields. Enter the MoEngage attribute (these will show up as user attributes on MoEngage) and select a Salesforce Field that the MoEngage attribute needs to be mapped to.
- Click Save.
- Define the identifier between the two systems. For MoEngage, identifier name is Customer ID. But it can be mapped to any field from the Contact object.
Any new contacts created or existing contacts updated will start showing up on your MoEngage dashboard.
Note-
If you are setting is up for the first time, the system will ask you to deploy the trigger on Salesforce. Click Deploy to continue.
Step 3: View profiles on MoEngage
- Navigate to Segment >> Create segment
- Search for the user via email id or any other identifier. And you will see the data flowing into MoEngage.
Sync real-time updates
By default, new sync configurations are automatically enabled for real-time updates. This means any modification to a record within the synced Salesforce object—even changes to fields not mapped for sync—will trigger an update to MoEngage.
To deactivate real-time syncs, just click on the Deactivate button next to the Sync.
Sync historical data
Pre-requisites
- Ensure your Salesforce Flex Queue is empty or has less than 50 items in the holding state. It is recommended that the historic sync is performed during your lean hours.
- Ensure an adequate batch size is selected. We recommend seeing the number of attributes and determining the size.
- A large batch size is likely to get dropped by MoEngage if the payload limits (100kb) are breached.
- A small batch size risks exhausting Salesforce Batch Jobs limits and the rate limits applied by MoEngage.
- Ensure you follow the limits for the Bulk Import API mentioned in the MoEngage help docs. If you wish to increase these limits, please speak to your MoEngage Customer Success Manager.
- Note: Any records without a Customer ID (for Users/Events) or Action (for Events) field will not be synced to MoEngage.
Performing a historic sync
- Click on the "Sync" button against your sync row.
Note: This button will be disabled if we notice more than 50 holding jobs in your Flex Queue to ensure the sync does not affect other Salesforce automation workflows.
- [Optional] You can change the batch size depending on your Salesforce settings:
- Click "Sync Historical Data".
Monitoring the Historic Sync
You can monitor the current progress of your Historic Sync by following these steps:
- Check your Salesforce Apex Flex Queue to ensure the historic sync is not in the Holding state. Search for the Apex Class
HistoricalSyncBatch
. If you find it in this state, you can reorder the batch to prioritize MoEngage. - If your Flex Queue is empty or has no records from the
HistoricalSyncBatch
Apex Class, the Batch has started processing. - Head to the Apex Jobs Queue and see a record submitted by the
HistoricalSyncBatch
Apex Class:
Check the following columns:
Column Name | Description |
---|---|
Status |
Status of the Historic Sync. If this is |
Batches Processed |
The number of batches sent to MoEngage. If this is less than the Total Batches, the sync is in progress. |
Failures |
This states the number of batches that have failed to be sent to MoEngage. |
Apex Class |
Ensure that this is |
Points to ensure a successful Historic Sync
- Ensure that only one Object in Salesforce is synced at a time.
- Ensure that you wait at least 15-30 minutes after the status of the Historic Sync has changed from
Processing
toCompleted
in the Apex Jobs Queue before proceeding to the next Historic Sync. - Ensure that the Salesforce Limits are not breached. A smaller batch size might breach the 250,000 Apex operations limit on Salesforce. This means no other batch operation can be performed in Salesforce within the 24-hour rolling window. You can read more about Salesforce Batch Apex Limitations to understand an adequate batch size for which you should operate.