Skip to main content

Deep link and push notification tracking

Introduced in version 0.11 of the tracker

Deep link and push notification tracking is available in the Flutter tracker since version 0.11.0.

The Flutter tracker provides two event types for tracking how users arrive at your app through deep links and push notifications: DeepLinkReceived and MessageNotification. Both event types are supported on iOS and Android. They are not supported on the Web.

A deep link is a URL that takes the user directly to a specific location within your app. The mobile operating system receives the deep link and passes it to your app. The tracker does not capture deep links automatically — you must track them manually when your app receives one.

The DeepLinkReceived event uses the schema iglu:com.snowplowanalytics.mobile/deep_link_received/jsonschema/1-0-0.

dart
tracker.track(DeepLinkReceived(
url: 'https://example.com/product/123',
referrer: 'https://example.com/home',
));

After tracking a DeepLinkReceived event, the tracker automatically attaches a deep_link entity to the next ScreenView event. This entity makes it easy to analyze the relationship between the deep link source and the screen the user viewed.

The DeepLinkReceived event and the subsequent ScreenView event also have the URL and referrer information added to the page_url and page_referrer atomic event properties. This makes them compatible with data models and enrichments built for events tracked on the Web.

The DeepLinkReceived event can be used with the campaign attribution enrichment in your Snowplow pipeline. When a user taps an advertising banner or marketing message that opens your app via a deep link, the enrichment can parse UTM parameters in the URL to attribute the session back to the originating campaign.

Properties

PropertyTypeDescriptionRequired
urlStringURL in the received deep link.Yes
referrerStringReferrer URL, source of the deep link.No

Track push notification events

Push notifications are messages delivered to the user's device even when your app is in the background or closed. You can track when a user receives or interacts with a push or local notification using the MessageNotification event.

The MessageNotification event uses the schema iglu:com.snowplowanalytics.mobile/message_notification/jsonschema/1-0-0.

dart
tracker.track(MessageNotification(
title: 'New message',
body: 'You have a new message from Alice.',
trigger: MessageNotificationTrigger.push,
action: 'view',
category: 'chat',
notificationCount: 3,
notificationTimestamp: '2025-09-09T10:00:00.000Z',
sound: 'chime.mp3',
attachments: [
MessageNotificationAttachment(
identifier: 'att1',
type: 'image/png',
url: 'https://example.com/image.png',
),
],
));

Properties

Required properties:

PropertyTypeDescription
titleStringThe notification's title.
bodyStringThe notification's body.
triggerMessageNotificationTriggerThe trigger that raised the notification.

Optional properties:

PropertyTypeDescription
actionStringThe action associated with the notification.
attachmentsList<MessageNotificationAttachment>Attachments added to the notification.
bodyLocArgsList<String>Variable string values to substitute format specifiers in bodyLocKey to localize the body text.
bodyLocKeyStringThe key to the body string in the app's string resources to localize the body text.
categoryStringThe category associated with the notification.
contentAvailableboolWhether the app is notified of delivery when in the foreground or background (iOS only).
groupStringThe group that this notification is part of.
iconStringThe icon associated with the notification (Android only).
notificationCountintThe number of items this notification represents.
notificationTimestampStringThe time when the notification event occurred (ISO 8601 format).
soundStringThe sound played when the device receives the notification.
subtitleStringThe notification's subtitle (iOS only).
tagStringAn identifier similar to group but for different purposes (Android only).
threadIdentifierStringAn identifier similar to group but for different purposes (iOS only).
titleLocArgsList<String>Variable string values to substitute format specifiers in titleLocKey to localize the title text.
titleLocKeyStringThe key to the title string in the app's string resources to localize the title text.

Trigger values

The trigger property uses the MessageNotificationTrigger enum:

ValueDescription
pushA push notification from a remote server.
locationA notification triggered by a location condition.
calendarA notification triggered by a calendar event.
timeIntervalA notification triggered after a time interval.
otherAny other trigger type.

Attachments

Use MessageNotificationAttachment to describe media or file attachments included in the notification.

PropertyTypeDescriptionRequired
identifierStringAttachment identifier.Yes
typeStringAttachment type.Yes
urlStringAttachment URL.Yes