Overview
BlueConic webhooks allow you to sync profile or segment data to OneSignal in real time whenever specific events occur on your site. This guide demonstrates how to configure BlueConic to send data to OneSignal via the Update user API.Requirements
- A OneSignal-enabled Web Application. See Web push setup to get started.
Setup
To sync user data between BlueConic and OneSignal, a common identifier must exist to associate users across both platforms. BlueConic generates a unique identifier called BlueConic ID, which can be linked to a user in OneSignal to synchronize data.Update script
We recommend creating a custom alias to identify your users using their BlueConic IDs. Before assigning a new alias, ensure the user is logged in to OneSignal first. The following code provides examples of associating a BlueConic ID with a OneSignal user using an Alias and an External ID.OneSignal.login
.
Add webhooks
Use webhooks to synchronize data from BlueConic to OneSignal based on your specific needs. The examples below demonstrate how to use the Update user API to achieve this. API detailsURL | https://api.onesignal.com/apps/<APP_ID>/users/by/alias_label/alias_value |
Method | PATCH |
Authorization | Basic <API_KEY> |
https://api.onesignal.com/apps/<APP_ID>/users/by/external_id/{{blueconic_profile_id}}
Syncing Profile properties
Synchronize BlueConic profile data to OneSignal by setting Tags and other user data.
Example configuration for updating tags
Syncing segments
Synchronize BlueConic segment data to OneSignal by setting Tags. Use these tags to create segments directly within OneSignal.
Example configuration for keeping segments in sync