Sync Salesforce objects to MoEngage

Integration 

library_add_check

Prerequisites

  • Follow the steps mentioned here to install and setup the MoEngage app from Salesforce app-exchange. 

 

Scope 

Context Support status  
Sync standard salesforce entities such as Contacts, Leads, Accounts, Opportunities, etc to MoEngage as users or events  Supported :check_mark:
Sync custom salesforce objects to MoEngage as users or events  Supported :check_mark:
Support for all standard salesforce fields- String, DateTime, Numeric, Formula fields, Object types (such as Salesforce standard geo location field object)  Supported :check_mark:
Send historical data sync to MoEngage  Supported :check_mark:
Real time data sync on new record creation or record updates  Supported :check_mark:
Create new attributes on MoEngage while setting up the data sync Supported :check_mark:
Sync linked entities (relationships between entities) to MoEngage  

Not supported :cross_mark:

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 

  1. Connections- Connections is the authorisation to your MoEngage workspace. You can connect multiple MoEngage workspace to a single Salesforce instance. 
  2. 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”. 
Screenshot 2024-09-25 at 3.08.31 PM.png

Step 1: Setup a connection 

  1. Click Connections >> Add New ConnectionScreenshot 2024-09-25 at 3.29.41 PM.png
  2. Enter your MoEngage workspace details 
    Screenshot 2024-09-25 at 3.34.12 PM.png
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 

  1. Click Map Fields.
    Screenshot 2024-09-25 at 3.42.08 PM.png
  2.  Click Add new sync 
    Screenshot 2024-09-25 at 3.43.02 PM.png
  3. Enter basic sync details   
    Screenshot 2024-09-25 at 3.43.32 PM.png
  4. Click Next 
  5. Configure data mapping between the two systems 
    1. 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. 
      Screenshot 2024-09-25 at 3.57.51 PM.png
    2. 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. 
      Screenshot 2024-09-25 at 4.00.39 PM.png
    3. Click Save.

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. 
Screenshot 2024-09-25 at 4.15.58 PM.png

Step 3: View profiles on MoEngage

  1. Navigate to Segment >> Create segment
  2. 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

  1. Click on the "Sync" button against your sync row. 
    Screenshot 2024-09-25 at 4.12.15 PM.png


    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.

  2. [Optional] You can change the batch size depending on your Salesforce settings:
    Screenshot 2024-09-25 at 4.12.21 PM.png
  3. Click "Sync Historical Data".

Monitoring the Historic Sync

You can monitor the current progress of your Historic Sync by following these steps:

  1. 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.
  2. If your Flex Queue is empty or has no records from the HistoricalSyncBatch Apex Class, the Batch has started processing.
  3. 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 Processing, the data sync is in progress. When this is Completed it means that all the records have been sent to MoEngage for processing.
This does not ensure the full delivery. MoEngage can still reject your records based on various factors.

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 HistoricalSyncBatch

 

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 to Completed 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.

Previous

Next

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

How can we improve this article?