Database, DMP, & CRM integration

Linking your database user data with OneSignal

Integrating your Database with OneSignal

Integrating OneSignal with your database unlocks a wealth of opportunities to enhance your customer engagement strategies, streamline communication, and ultimately drive better results for your business. By connecting OneSignal with databases like Salesforce, DPMs (Data Management Platform), and CRMs (Customer Relationship Management), you can leverage the full potential of your customer data to deliver personalized, timely, and relevant messages. Here’s why this integration is valuable:

1. Enhanced Personalization

When you integrate OneSignal with your database, you can sync your customer data directly, allowing you to create highly personalized messages based on real-time insights. For instance, by connecting with Salesforce, you can automatically send targeted notifications based on customer behavior, preferences, or lifecycle stages. If a lead has just moved from the consideration to the decision phase in Salesforce, OneSignal can trigger a personalized message encouraging them to finalize a purchase or sign up for a demo.

2. Real-Time Communication

Integration ensures that your communication is not just personalized but also timely. By connecting OneSignal with a CRM, you can automate messages to be sent at critical moments, such as welcoming a new customer, reminding them of an abandoned cart, or thanking them after a purchase. For example, integrating with a DPM allows you to send push notifications to customers who have interacted with your brand across multiple channels, ensuring that your messaging is cohesive and immediate, reflecting the most current data.

3. Data-Driven Decision Making

With a seamless integration between OneSignal and your database, you can easily analyze the effectiveness of your campaigns. For example, integrating with Salesforce allows you to track which messages are converting leads into customers, providing valuable insights that you can use to optimize future campaigns. By understanding what works, you can make data-driven decisions to enhance your customer engagement strategies, ensuring that every message you send is contributing to your business goals.

4. Improved Efficiency and Automation

Manually managing customer communications can be time-consuming and prone to errors. By integrating OneSignal with your CRM or DPM, you can automate the process, freeing up your team to focus on more strategic tasks. For example, when a customer’s information is updated in your CRM, OneSignal can automatically adjust their messaging preferences or trigger specific campaigns without requiring manual intervention. This level of automation not only saves time but also ensures consistency and accuracy in your communication efforts.

5. Scalable Communication

As your business grows, so does the complexity of managing customer interactions. Integration allows you to scale your communication efforts without compromising on personalization or timing. Whether you're handling a growing number of leads in Salesforce or managing a larger database in your CRM, OneSignal's integration can help you maintain a high level of customer engagement. For instance, you can use segmentation tools within your CRM to create more specific audience groups, and OneSignal will handle the delivery of messages to these groups, ensuring that even as your customer base expands, your messaging remains relevant and effective.

Example Integrations:

  • Salesforce: Automatically send follow-up notifications to leads who haven’t responded to a sales offer or reach out with personalized promotions to customers based on their past purchases.
  • DPM: Integrate with your DPM to deliver targeted push notifications to customers who have shown interest in specific products or content, ensuring your messages align with their most recent interactions.
  • CRM: Use your CRM integration to trigger automated birthday wishes, renewal reminders, or special offers based on customer milestones, ensuring that each customer feels valued and engaged.

Integrating OneSignal with your database provides significant value by enhancing personalization, enabling real-time communication, facilitating data-driven decisions, improving efficiency through automation, and allowing for scalable communication strategies. These benefits combine to create a more effective and responsive customer engagement strategy that can drive better business outcomes.

This guide details how to sync your user data from an external Database, CRM or Data Management Platform (DMP) with OneSignal where existing integration connectors are not yet available. There are two distinct steps to take:

Integration Setup

Common User Identifier

The most important aspect to support the integration will be a common unique user identifier between your Database, DMP or CRM systems and OneSignal - which will be referred to as "systems" for the remainder of this guide.

OneSignal provides a custom field for all users called external_id which should be the common unique user identifier between the systems. This will remove the onus on your end to map OneSignal generated user identifiers in the form of subscription_id or OneSignal ID with your own unique identifier.

To set the external_idthrough OneSignal's mobile SDK, you can use our OneSignal.login method:

OneSignal.login("external_id");
OneSignal.login("external_id")
[OneSignal login:@"external_id"];
OneSignal.login("external_id")
OneSignal.Login("external_id");
OneSignal.login("external_id");
OneSignal.login("external_id");
window.plugins.OneSignal.login("external_id");

When handling multiple identifiers it may be convenient to also set aliases such such as facebook_id, google_id or indeed any identifying label. OneSignal supports up to 10 different aliases to be set per user. In the example below you can set a CRM identifier.

OneSignal.getUser().addAlias("ALIAS_LABEL", "ALIAS_ID");
OneSignal.User.addAlias("ALIAS_LABEL", "ALIAS_ID")
[OneSignal.User addAliasWithLabel:@"ALIAS_LABEL" id:@"ALIAS_ID"];
OneSignal.User.addAlias(label: "ALIAS_LABEL", id: "ALIAS_ID")
OneSignal.User.AddAlias("ALIAS_LABEL", "ALIAS_ID");
OneSignal.User.addAlias("ALIAS_LABEL", "ALIAS_ID");
OneSignal.User.addAlias("ALIAS_LABEL", "ALIAS_ID");
window.plugins.OneSignal.User.addAlias("ALIAS_LABEL", "ALIAS_ID");

It is also recommended to disassociate external_id when your Customers log out or are no longer authenticated to prevent any messages being delivered to the device. You can use OneSignal.logout() method to achieve this.

OneSignal.logout();
OneSignal.logout()
[OneSignal logout]
OneSignal.logout()
OneSignal.Logout();
OneSignal.logout();
OneSignal.logout();
window.plugins.OneSignal.logout();

Updating User Data

There are two options available to synchronize user data from your source of truth, such as Salesforce, DMP or any CRM, to OneSignal. You can use any combination of the following methods:

a) Update User API: This is the recommended approach where automation, recency and speed of updates are important. This API endpoint comes with generous rate limits in which up to 100 User modifications can be made per request with up to 1000 requests per second. An advantage with OneSignal's user identity is that you are able to leverage more than a single customer identifier as it's quite possible with today's average technology stack that multiple unique identifiers are adopted across an organization such as facebook idor google id. The below sample request is an update to a user identified by their external_idwhere property and event information such as first_name and purchase_event are passed to OneSignal.

curl --location --request PATCH '<https://api.onesignal.com/apps/app_id/users/by/external_id/1695367530017'>  
--header 'Content-Type: application/json'  
--header 'Authorization;'  
--data '{  
  "properties": {  
    "tags": {"first_name":"George","account_type":"Advanced Plus","purchase_event":"True","purchase_event_time";"1724751229","purchase_event_value":"49.99","purchase_event_currency":"USD"}  
}  
}'

Below is a cURL request where a user update is made using a facebook_id alias.

curl --location --request PATCH '<https://api.onesignal.com/apps/app_id/users/by/facebook_id/1695367530017'>  
--header 'Content-Type: application/json'  
--header 'Authorization;'  
--data '{  
  "properties": {  
    "tags": {"first_name":"George","account_type":"Advanced Plus","purchase_event":"True","purchase_event_time";"1724751229","purchase_event_value":"49.99","purchase_event_currency":"USD"}  
}  
}'

b) CSV Import: Synchronizing user data from a source of truth such as your CRM or DMP can also take a manual and controlled form. This method is recommended for situations where bulk synchronization, lower frequency and seasonality demand are common. As virtually all tools provide an out of the box export/import function in CSV format this approach can be surprisingly simple and easy to take, although it should only be adopted where appropriate as manual input is required.

To access a recording where dashboard users can make updates to users please visit the section of guide here. In the below example the dashboard provides a confirmation step prior to making the updates which illustrates the identified fields and their values such as a list of first_name, product_countand loyalty_member status are displayed. We recommend to toggle "Automatically create a segment for this import" so that you can immediately use the new and updated audience in your messaging.

Linking Data Between OneSignal and a Database

Other common data you want to link between your Database and OneSignal are:

Most custom data can be stored to OneSignal in the form of Data Tags which are key:value pairs of string or integer data. We do not recommend storing array or dictionary data types as tags.

Any data tags sent to OneSignal should be for the purpose of sending notifications, either through creating Segments or using API Filters.

Tags can also be used within notifications for Message Personalization, i.e adding custom information into the push like the "username" or "last product added to cart".