Access the event stream data using Liquid syntax. Wrap the desired data point in {{ }} to capture that data in the Event Stream. See Examples.

event properties

The event object includes the following properties:

Kind

Type: String The message type (push, email, sms, iam) and event (e.g. received, sent, clicked, failed, unsubscribed, displayed, pagedisplayed, opened, clicked, unsubscribed, reported_as_spam, hardbounced, failed, supressed). Usage: {{ event.kind }}
Message Event Kind (OneSignal)Event name (in data set)Event Description
Push Sentmessage.push.sentPush notification successfully sent to the push services (FCM, APNS, etc).
Push Receivedmessage.push.receivedPush notification received by recipient. Not available on all platforms. See Confirmed Delivery for more details.
Push Clickedmessage.push.clickedUser tapped the push notification to open the app on device.
Push Failedmessage.push.failedPush failed to be sent. See the Push Message Reports for details.
Push Unsubscribedmessage.push.unsubscribedUser unsubscribed on push subscription. See When do push subscription statuses update?.
In-App Impressionmessage.iam.displayedIn-App Message successfully displayed on device.
In-App Clickedmessage.iam.clickedUser tapped an element on the In-App Message.
In-App Page Displayedmessage.iam.pagedisplayedIn-App Message page was displayed. Helpful for tracking carousels.
Email Sentmessage.email.sentEmail successfully sent.
Email Receivedmessage.email.receivedEmail received by recipient.
Email Openedmessage.email.openedEmail was opened by recipient. See Email Message Reports for details.
Email Link Clickedmessage.email.clickedUser tapped a link in the email.
Email Unsubscribedmessage.email.unsubscribedUser unsubscribed from email via the unsubscribe link.
Email Reported As Spammessage.email.reported_as_spamUser reported the email as spam. Gmail requires Google Postmaster Tools to track. See Email deliverability for more details.
Email Bouncedmessage.email.hardbouncedEmail returned to sender due to permanent error. See Email Message Reports for details.
Email Failedmessage.email.failedEmail could not be delivered. See Email Message Reports for details.
Email Suppressedmessage.email.supressedEmail could not be sent because the email address is on the Suppression list.
SMS Sentmessage.sms.sentSMS sent to recipient
SMS Failedmessage.sms.failedSMS failed to send. See SMS Message Reports for details.
SMS Deliveredmessage.sms.deliveredSMS successfully delivered
SMS Undeliveredmessage.sms.undeliveredSMS could not be sent. See SMS Message Reports for details.

Event ID

Type: UUID A unique, OneSignal-generated identifier for each individual event in UUID v4 format. Use this ID for idempotent delivery tracking. If you are looking for the specific message or template identifier, use message.id or message.template_id. Usage: {{ event.id }}

Timestamp

Type: Integer The UNIX timestamp of the event. Usage: {{ event.timestamp }}

UTC datetime

Type: String A human-readable time of the event in UTC (specifically an ISO string like “2024-02-21T23:45:15.228Z”). Usage: {{ event.datetime }}

App ID

Type: UUID The OneSignal App ID. Usage: {{ event.app_id }}

Subscription type

Type: String The subscription type (e.g. iOS, Android, Chrome, Email, SMS, etc). Usage: {{ event.subscription_device_type }}

Subscription ID

Type: UUID The OneSignal Subscription ID. Usage: {{ event.subscription_id }}

OneSignal User ID

Type: UUID The OneSignal created User ID. Usage: {{ event.onesignal_id }}

External User ID

Type: String Your User ID set as the OneSignal External ID alias. Can be empty if not set in OneSignal. Usage: {{ event.external_id }}

In-app message page name

Type: String The name of the page or card that is displayed for certain in-app message events. See In-app message Event Streams for details. Usage: {{ event.data.page_name }}

In-app message page ID

Type: String A unique identifier for the page or card that is displayed for certain in-app message events. See In-app message Event Streams for details. Usage: {{ event.data.page_id }}

In-app message target name

Type: String The name of the button or image block element clicked. Must contain a In-app click action. See In-app message Event Streams for details. Usage: {{ event.data.target_name }}

In-app message target ID

Type: String A unique identifier for the button or image block element clicked. Must contain a In-app click action. See In-app message Event Streams for details. Usage: {{ event.data.target_id }}

Example Input

{
  "event.kind": "{{ event.kind }}",
  "event.id": "{{ event.id }}",
  "event.timestamp": "{{ event.timestamp }}",
  "event.datetime": "{{ event.datetime }}",
  "event.app_id": "{{ event.app_id }}",
  "event.subscription_device_type": "{{ event.subscription_device_type }}",
  "event.subscription_id": "{{ event.subscription_id }}",
  "event.onesignal_id": "{{ event.onesignal_id }}",
  "event.external_id": "{{ event.external_id }}",
  "event.data.page_name": "{{ event.data.page_name}}",
  "event.data.page_id": "{{ event.data.page_id}}",
  "event.data.target_name": "{{ event.data.target_name}}",
  "event.data.target_id": "{{ event.data.target_id}}"
}

Message properties

The message object is designed to keep you informed of the messages sent to the end-user. It includes properties like id, template_id, and content, which contains the actual text of the message.

Message ID

Type: UUID The message ID generated by OneSignal. Usage: {{ message.id }}

Message Name

Type: String The name of the message as set in the dashboard or using the API name property. Usage: {{ message.name }}

Message Title

Type: Object The title of the push message or email subject as set in the dashboard or using the API headings or email_subject properties. Usage: {{ message.title }}

Message Contents

Type: Object The contents of the push or SMS message as set in the dashboard or using the API contents property (clipped at 50 characters). Email contents (email_body) are not provided. Usage: {{ message.contents }}

Template ID

Type: UUID The template ID for a message sent via Journeys or the API template_id property. Usage: {{ message.template_id }}

Launch URL

Type: String The message’s launch URL (when using only one URL that is web and app agnostic). See URLs, Links and Deep Links for details. Usage: {{ message.url }}

App-Specific URL

Type: String The message’s launch URL when using both a web and app-specific URL. See URLs, Links and Deep Links for details. Usage: {{ message.app_url }}

Web-Specific URL

Type: String The message’s launch URL when using both a web and app-specific URL. See URLs, Links and Deep Links for details. Usage: {{ message.web_url }}

Example Message Object

{
  "message.id": "f3c9cd09-10d7-4f59-b9bc-66e16607f1d5",
  "message.name": "the-name-you-set",
  "message.title": "Claim 50% Off Today", // email subject example
  "message.title": "{'en':'the message title/headings'}", // push title example
  "message.contents": "{'en':'the message content'}",
  "message.template_id": "the-template-uuid-if-set",
  "message.url": "the-message-url",
  "message.app_url": "the-message-app-url",
  "message.web_url": "the-message-web-url"
}

User properties

OneSignal ID

Type: String The user’s OneSignal ID. Usage {{ user.onesignal_id }}

External ID

Type: String The user’s External ID. Usage: {{ user.external_id }}

Tags

Type: Object The user’s tags. Usage:
  • Tags object: {{ user.tags }}
  • Specific tag string: {{ user.tags.your_tag }}
  • If you are trying to get all tags, reference the tags object like {{ user.tags}}.
  • If you are trying to get a specific tag, reference the tag as a string like: "{{ user.tags.your_tag | default: '' }}".

Language

Type: String The user’s language. Usage: {{ user.language }}

Subscription properties

Subscription ID

Type: String The ID of the subscription the message was sent to. Usage: {{ user.subscription.id }}

App ID

Type: String The ID of the app. Usage: {{ user.subscription.app_id }}

Subscription Token

Type: String The token for the subscription the message was sent to.
  • If the type is Email, the token will be an email address.
  • If the type is SMS, the token will be a phone number in E.164 format.
  • If the type is one of the Push options, the token will be a push token.
Usage: {{ user.subscription.subscription_token }}

Session Count

Type: Number The session count for the subscription the message was sent to. Usage: {{ user.subscription.session_count }}

Language

Type: String The language set on the subscription the message was sent to. Usage: {{ user.subscription.language }}

Game Version

Type: String The game version set on the subscription the message was sent to. Usage: {{ user.subscription.game_version }}

Last Active

Type: Number The last active time set on the subscription the message was sent to. Usage: {{ user.subscription.last_active }}

Play Time

Type: Number The play time set on the subscription the message was sent to. Usage: {{ user.subscription.play_time }}

Amount Spent

Type: Number The amount spent on the subscription the message was sent to. Usage: {{ user.subscription.amount_spent }}

Created At

Type: Number The creation time of the subscription the message was sent to. Usage: {{ user.subscription.created_at }}

Subscribed

Type: Boolean Indicates whether the subscription the message was sent to is currently subscribed. Usage: {{ user.subscription.subscribed }}

SDK

Type: String The SDK version set on the subscription the message was sent to. Usage: {{ user.subscription.sdk }}

Device Model

Type: String The device model set on the subscription the message was sent to. Usage: {{ user.subscription.device_model }}

Device OS

Type: String The device operating system set on the subscription the message was sent to. Usage: {{ user.subscription.device_os }}

Tags

Type: Object The user’s tags. You can access the entire object or specific tags. Usage:
  • All Tags: {{ user.tags }}
  • Specific Tag: {{ user.tags.your_tag }}