URLs, Links, and Deep Links
Learn how to set up and use URLs, links, and deep links in OneSignal messages including Push, Email, In-App Messages, and SMS.
Overview
You can include URLs and deep links in Push, Email, In-App Messages, and SMS. This guide explains how to set up these links correctly, how link tracking works, and when to use deep links.
For more advanced linking like custom schemes or app routing, see our Deep Linking guide.
Platform linking options
Launch URL
Use the Launch URL to open a link when the notification is clicked. This typically opens in the default browser and should start with https://
.
To use http://
URLs with Apple devices, you must setup the NSAppTransportSecurity property in your app’s Info.plist
file.
If you’re using a mobile deep link like your-custom-scheme://
, results may vary. See Deep Linking.
Targeting multiple platforms
If you send a single message to both web and mobile users, use:
url
— for general targeting across all platforms.web_url
— for web push Subscriptions.app_url
— for mobile Subscriptions.
OneSignal Dashboard – Launch URL Field
Additional data
Instead of Launch URL, you can use the Additional Data field (data
in the API) to send custom data with your push and handle this data in your app using the SDK’s Notification Click Listener via the additionalData
property. This might be a better option than Launch URL to provide more flexibility.
Send a URL to read within your app via the Additional Data field.
Launch URL
Use the Launch URL to open a link when the notification is clicked. This typically opens in the default browser and should start with https://
.
To use http://
URLs with Apple devices, you must setup the NSAppTransportSecurity property in your app’s Info.plist
file.
If you’re using a mobile deep link like your-custom-scheme://
, results may vary. See Deep Linking.
Targeting multiple platforms
If you send a single message to both web and mobile users, use:
url
— for general targeting across all platforms.web_url
— for web push Subscriptions.app_url
— for mobile Subscriptions.
OneSignal Dashboard – Launch URL Field
Additional data
Instead of Launch URL, you can use the Additional Data field (data
in the API) to send custom data with your push and handle this data in your app using the SDK’s Notification Click Listener via the additionalData
property. This might be a better option than Launch URL to provide more flexibility.
Send a URL to read within your app via the Additional Data field.
For unsubscribe links, see Unsubscribe Links & Email Subscriptions for details.
OneSignal automatically tracks user clicks of links within your emails. This tracking is performed at two levels:
-
Per email, where any click of any link is counted per email or email template. This is used to calculate message-level click-through rate and click-to-open rate. This is reported as both:
- Total clicks, where the same user clicking the same link in the same delivered email multiple times is counted multiple times
- Unique clicks, where the same user licking the same link in the same delivered email multiple times is counted once
-
Per link per email, where any click of any link is counted for that specific link within an email or email template. This is also reported as total and unique counts. OneSignal will calculate link-level click stats for the first 30 links found in each email.
Tracking email link clicks requires changing the URL to capture the event, then redirecting the user back to the original URL you set. This happens almost instantly but may cause unexpected behavior, particularly with deep links. For example, a URL like:
https://some-domain.com/the-page
will be obfuscated to something like:
https://some-domain/c/eJxU0D2uGzEMBODTrDoZJPW3...
It will then immediately redirect to the intended URL.
This behavior is normal and nearly invisible to users. However, it may have unexpected behavior when using Deep links and may require you to Disable Link Click Tracking.
Enable link click tracking
This feature is enabled by default and in most cases does not require further configuration. As long as Track link clicks is checked for your email or email template, OneSignal will track link clicks.
In some cases, especially if you are constructing links with Liquid syntax we may not detect a link and track it automatically. You can explicitly tell us to track a link using Liquid like so:
Disable link click tracking
To disable click tracking for all links in an entire email:
- Dashboard: Uncheck Track link clicks.
- API: Set
disable_email_click_tracking: true
.
Track link clicks is disabled.
To disable an individual link from being tracked while Track link clicks is enabled, you can explicitly opt out of individual links using Liquid like so:
View Click Tracking Statistics
Email-level click tracking statistics are displayed at the top of the page for each email and email template in the Click-Through Rate card.
Link-level click tracking statistics are displayed in the Click Activity panel for each email and email template. The first 30 links will be tracked, with the remainder summarized as “All other links.”
- Disabling tracking means no click data (CTR will show “N/A”) in the Email Message Reports Click-Through Rate.
- All links will be untracked—no selective disabling.
In-app message image, button, and background elements have URL In-App Click Actions and HTML in-app messages have the openUrl
method in the In-App JS Library.
Depending on how your links are setup, you may need to deep link via the Action Name following the Deep Linking guide.
OneSignal provides trackable shortened links that you can add to any SMS.
Dashboard URL Shortener
To create a trackable shortened URL, click the Insert Trackable Link link beneath the message input box, and enter your link into the modal:
A modal for inputting the trckable link
Click the Insert trackable link button to add the short link to your message:
An example of a message preview with a trackable link.
In the message preview, the link will appear in your message as the placeholder like 1sgnl.co/XXXX
, which will be replaced with a trackable link for each user when the message is sent:
An example of a trackable link as it appears on a device.
API URL Shortener
To send trackable links via our API, please see our SMS create message API reference.
Dynamic URLs
You can create custom, user-specific URLs with Liquid Syntax and data from:
- User Properties (e.g.,
external_id
,email
) - Tags stored in OneSignal
custom_data
sent via the API
This enables personalized links in your messages that lead users to content tailored just for them.
Inject values like external_id
or email
directly into URLs.
Example:
If the user’s external_id
is 12345, the final URL will be:
Similarly:
If the user has an email address of john@example.com
, the final URL will be:
Inject values like external_id
or email
directly into URLs.
Example:
If the user’s external_id
is 12345, the final URL will be:
Similarly:
If the user has an email address of john@example.com
, the final URL will be:
Reference user tags stored in OneSignal.
Example:
If the user has a tag tag_key
with a value of technology
, the final URL will be:
If the tag tag_key
is not set, the URL will be:
Use the default
filter to set a default value if the tag is not set.
If the tag_key
is not set, the URL with the default
filter will become:
Using our Create message APIs and Templates. You can set the URL in the template with specific liquid syntax to reference the custom_data
object in the API request.
Example template URL:
Example API request with custom_data
:
The final URL will be:
Best practices:
- Only set data tags or
custom_data
for parts of the URL. Don’t include the protocol (https://
oryour-app-scheme://
) and domain in the URL. - Use the
default
filter to set a default value if the tag is not set.
For more details, see:
UTM Parameters
UTM parameters help track the performance of message campaigns by appending source
, medium
, and campaign
details to URLs. Simply add your UTM parameters directly into the URLs of your messages.
You can have OneSignal automatically add UTMs to push notification Launch URLs sent from the Dashboard.
FAQ
How can I link to the app store?
You can enter the store link as the launch URL. Examples:
Android - https://developer.android.com/distribute/marketing-tools/linking-to-google-play.html
iOS - get the link to the app store page, but replace https://
with itms-apps://
.
Can I link to another app?
For push and in-app messages, in most cases, you can setup a URL Scheme and deep link using the protocol x://
. For example, deep linking into Whatsapp, you can use: whatsapp://wa.me/15551234567
For email and sms, you will need to use the https://
app store link.
Can I prevent linking to my app or site?
Currently on mobile apps, anytime the user clicks the push it will open the app.
Web Push: If you do not want to link to any page or url, you can add ?_osp=do_not_open
to the end of a URL like this https://yoursite.com/page?_osp=do_not_open
as the launch url, this will prevent the push from going to any url upon click and will just dismiss the push.