Targeting options for web push notifications
You can send a web push notification to all your subscribers or reach only some of them: Pushpad offers different ways to target specific users or segments.
You can create multiple projects for each website. Each project has a list of subscribers and is similar to a "mailing list". You can create projects manually from the Pushpad dashboard (or use the REST API).
Warning: you can use multiple projects for the same domain, but they must be associated to the same sender.
Use multiple projects when:
- your website has a limited number of independent sections that don't change much over time. The communications are usually different for each group. For example a University may have two distinct projects, one for the communications with students and one for the communications with the professors. If you use Pushpad Pro and you have many sections please consider using tags instead, which are a more flexible solution: you can then created saved segments.
- you need complete separation between different environments. For example you may have separate projects for development, staging and production.
Use tags when:
- you have many segments, overlapping segments or segments generated dynamically. For example you can track the browsers which visit a page or perform an action on your website, in order to target them later.
- you want to let the user choose which notifications wants to receive on the current browser (example). For example you can add some checkboxes to your website, one for each topic, and use tags to memorize the notification preferences of the user (like email preferences, a user may want receive notifications about some topics and not about others).
You can read more about tags.
uid param if you use Pushpad Express).
Use the user IDs when:
- you have a web app with registered users that needs to send transactional notifications. A transactional notification is a notification that is sent automatically to a user or a group of users when something relevant happens. For example you may want to notify a message in a chat, a new post in a group, a new comment to a post, an event nearby, the delivery of a package, etc. You should always prefer the user IDs to tags for transactional notifications, so that you don't have to keep data syncronized between your application and Pushpad; moreover user IDs require a signature and provide better security than tags. Although we don't enforce an hard limit on the number of recipients, if you need to reach more than 10k users with a transactional notification, you may need to send multiple notifications with the same content, splitting the recipients in batches of 10k.
You can read more about user IDs.
Sometimes you want to allow the user to opt in only to certain notifications while muting others.
Use tags (or multiple projects) if you want to manage notification preferences for each browser.
- If you use Pushpad Express you can create multiple projects, one for each topic, associated to the same sender. Then you can share a link to the homepage of your subdomain to let the user choose which notifications wants to receive.
- If you use Pushpad Pro you can create a page with a checkbox for any topic that the user might want to receive. On page load use the
unsubscribefor that topic (i.e. tag). Because tags are associated to a browser, if the browser subscription is removed then also tags are removed.
- As an alternative to tags, if the users are logged in on your website, you can memorize the user preferences in your database. Then your app is responsible for determining the users who want to receive a notification and reach only them using their user IDs (uids). In this case the notification preferences are associated to the user rather than to the browser.