Use the OneSignal integration with ActiveCampaign to send push notifications to the web, mobile devices, and apps. Doing so lets you send direct and immediate communication to current and potential customers, drive engagement rates, re-engage inactive users, personalize customer experiences, and is a cost-effective addition to your marketing strategy.
This article will show you how to connect OneSignal to ActiveCampaign and use the integration to send push notifications.
Take note
- The following is required to set up the integration:
- ActiveCampaign account with automation permissions
- OneSignal account setup and configured to send push notifications
- Setup and configuration of the web app in OneSignal
- Push notification templates (if using) in OneSignal. Platforms supported include:
- Apple iOS (APNs)
- Google Android (FCM)
- Web
- OneSignal User auth key
- OneSignal Rest API key for each web app
- OneSignal External ID field for each Subscription record populated with the unique identifier for ActiveCampaign (email address)
- Email addresses captured through an ActiveCampaign form will automatically populate the OneSignal External ID field
- Note: Please contact your web or mobile app developer to configure a path to push the email address of an ActiveCampaign contact to the OneSignal External ID
- Note: OneSignal does not push the email address captured from the email or phone prompt within the Permission Prompt Setup
- For web push notifications - OneSignal stopped supporting new apps from using Blogger, Squarespace, Webflow, Weebly, Wix, HTTP sites, and website builders that don't support uploading Service Workers to a server (which are required for web push). Learn more here
- Wix Studio customers - Please review this article about uploading OneSignal's service worker file to your root directory
Watch a video
How it works
This integration is configured on the automation level. You can use either of the automation actions below, or both, to send push notifications:
- “OneSignal - Assign a tag” action - this action lets you send mobile in-app push notifications
- “OneSignal - Send push notification” action - this action lets you send web and mobile web push notifications
“OneSignal - Assign a tag” automation action
This setup has three main steps:
- Create a segment in OneSignal using the “UserTags” filter for the key/value pair you will use when configuring the automation action.
- Configure the push notification in OneSignal for mobile apps.
- Add the “OneSignal - Assign a tag” action to your automation. In this step, you will enter your OneSignal’s API Key and create a key/value pair during the configuration setup. This key/value pair must match the segment you created in OneSignal. When finished, set your automation to “Active.”
When a contact goes through your automation, the key/value pair tag is pushed to OneSignal. Any tag you send to OneSignal from this action will be created in OneSignal if it does not yet exist for contacts and updated if it does exist. To find the key/value pair tag, log into your OneSignal account, then navigate to Audience > Users.
“OneSignal - Send push notification” automation action
Once you add the “OneSignal - Send push notification” action to your automation, you will walk through the OneSignal authentication and configuration steps. You can use a OneSignal template for your push notification or manually create your message in the configuration.
After you connect the integration and set your automation to “Active,” contacts who enter your automation and make it to your OneSignal action are sent a push notification to the web or mobile device. In addition, the activity stream on contact records will show that the contact entered and completed your automation.
You can find reporting for this integration in your OneSignal account. You can also use ActiveCampaign to create an advanced search of all contacts who entered your OneSignal automation.
This integration does not add tags to contacts. If you want to add tags to contacts who were sent a push notification, you must add the “Add a tag” action to your automation, following the OneSignal action.
Reporting
You can find reporting for this integration in your OneSignal account. You can also use ActiveCampaign to create an advanced search of all contacts who entered your OneSignal automation.
Connect OneSignal to ActiveCampaign with the “OneSignal - Assign a tag” automation action.
You must create segments in OneSignal to use this automation action. Once the segment is defined, you can send mobile in-app notifications directly from OneSignal. ActiveCampaign cannot directly send in-app push notifications from automations.
-
Create a segment in OneSignal:
- Log into your OneSignal account
- Navigate to Audience > Segment > New Segment
- Create your new segment by adding the “User Tags” filter for the key/value pair created in step 3 above. To learn more, read OneSignal’s guide on segmentation
- Create the message you want to send to your segment. To learn more, read OneSignal’s guide on in-app messaging.
- Gather the OneSignal app-level API key and save it to a file for step 5 (below). This API key is located under the ActiveCampaign App > Keys & IDs.
- From ActiveCampaign, create or edit an automation.
-
Drag the “OneSignal - Send a push notification” action to your automation. You can find this action under the “Apps” portion of the automation action menu. Enter the following information into the fields provided:
- OneSignal API key
- Data tag key
- Data tag value
- For best practices on creating the key/value pair, please read OneSignal’s Add user data tags help article
- Finish building your automation, then set it to “Active.”
Connect OneSignal to ActiveCampaign to send push notifications
This automation action lets you send push notifications to web and mobile devices.
- Ensure you have the following setup on the OneSignal side: OneSignal account configured to send push notifications, ActiveCampaign App, and Templates (recommended).
- Gather the following information from OneSignal and save it to a file for step 5 (below):
- User auth key - This is the account-level key and is located under Account & API Keys
- OneSignal - This is the app-level API key and is located under the ActiveCampaign App > Keys & IDs for the ActiveCampaign app
- From ActiveCampaign, create or edit an automation.
- Drag the OneSignal action to your automation. It is under the “CX Apps” portion of the automation action menu.
-
Complete the following steps in the OneSignal automation action to connect the integration:
- Paste your OneSignal User Auth Key into the field provided, then click “Connect”
- Select the web app you wish to use from the dropdown menu
- Paste the web app API key
-
Select the push notification template you wish to use (recommended). You can manually create your push notification here if you do not want to use a template.
- To manually create a push notification in the automation action: enter your URL, heading (subject line), and content
- You can also use personalization tags for the following in your message: Contact, Account, Deal, Ecommerce, and Custom objects
- ActiveCampaign's personalization tags do not work with OneSignal's templates
- Click the “Finish” button
Capture email address for OneSignal with ActiveCampaign Forms
This option is for advanced users. You need to be comfortable with HTML. Our Customer Experience team cannot help you implement or troubleshoot code.
With the OneSignal Web SDK, you can add custom code to your ActiveCampaign Forms to capture the Contact’s email address on submission and add them as subscribers in OneSignal.
First, install the OneSignal Web SDK on your website by following the startup guide from OneSignal’s documentation.
Once you have verified that the Web SDK has been installed, the next step is to add the ActiveCampaign form to your site.
In ActiveCampaign:
- Click Website > Forms on the left menu.
- Create a new form and choose the “Inline form” option.
- After designing the form, click the “Integrate” button on the top right corner.
- Find the “full embed” code, select it, and copy it.
In your website’s HTML (where the ActiveCampaign Form will be displayed):
- Paste in the copied form code.
- Search for a function in the included javascript called form_submit. The first line in this function should be e.preventDefault() This is important.
- The OneSignal code should be inserted after the e.preventDefault() line in this function.
- On a new line below the e.preventDefault() line, add the following code:
var userEmail = document.getElementById("email").value;
OneSignalDeferred.push(async function(OneSignal) {
await OneSignal.User.addEmail(userEmail);
await OneSignal.login(userEmail);
});
When your ActiveCampaign form is submitted, the submitter’s email address will be passed into the OneSignal External ID field.
Troubleshooting
Review your Template settings to allow pushes on various devices.
- Web Push troubleshooting guide
- Mobile Push troubleshooting guide
- Common reasons why Web Push notifications are not showing on your device
- Common reasons why Mobile Push notifications are not showing on your device