OneSignal Help & Documentation

Welcome to the OneSignal New IA developer hub. You'll find comprehensive guides and documentation to help you start working with OneSignal New IA as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Discussions

Message Personalization

Concepts - Ways to personalize messages to individual users

Personalizing notifications helps users connect more with your app or site. Common examples are putting the person's name or abandoned cart item in the notification title or message.

There are generally 2 ways to go about this. 1) Using OneSignal's Data Tags and following the below guide for substituting the tag key for it's value in each push.
2) Tracking the User Id through your own CRM or Database and targeting the device directly with custom messages.

Tag & Variable Substitution

Notification contents such as message body, title, subtitle and launch URL support place holders inline. They can be substituted with tag values for each user. These can be set on the user with the sendTag(s) functions on our SDKs.

Let says for example you want to send a notification with their name and current stage they are on in your game. Example:
Hello Josh! We just improved our controls, come back and see if you can beat level 10!

Add {{ tag_key | default: 'default_value' }} inline with your message text. Replacing tag_key with your own key, as well as the required default value. Example let say you have the following 3 users.
User 1: tags: {name: "Josh", current_stage: 10}
User 2: tags: {name: "George", current_stage: 9}
User 3: tags: {}

Send a notification with the following contents:

Hello {{ name | default: 'there'}}!
We just improved our controls, come back and see if you can beat level {{ current_stage | default: '1' }}!

This will result in the following notifications going out to each user.

User 1

Hello Josh! We just improved our controls, come back and see if you can beat level 10!

User 2

Hello George! We just improved our controls, come back and see if you can beat level 9!

User 3

Hello there! We just improved our controls, come back and see if you can beat level 1!

Target Directly by User Id

You can detect the User Id and target the device directly with custom push message. You can use the OneSignal Player ID or your own External User Id.

For integrating your CRM or Database see the Internal Database, DMP, & CRM Guide.

Also more details on this in our Transactional Messages Guide.


Message Personalization


Concepts - Ways to personalize messages to individual users

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.