Tags and Segments
Create audience segments based on user data
Tags are one of the most useful tools we offer — a lot of sophisticated Pushwoosh functionality is based on this feature. Using tags, you can segment your audience and send push notifications to some users, but not others.

Deciding Which Tags To Use

First, think about your business needs and decide how you want to segment your audience. Do you need to target users based on age, location, in-app purchase history, etc.? Once you’ve decided on segmentation logic, your developers can add tags to your app’s code, which will then allow you to send targeted messages to your users.
Tags contain any arbitrary data that you associate with a particular user or device, whether it's username, ID, city, favorite football team, preferred news categories, or any other piece of information about your users. Let’s take a closer look.

Tag Values

Tag values can help you make your push campaigns smarter. Each tag is capable of storing nearly limitless number of values. Basically, this means that one tag would be enough to record a specific type of information about each end-user in your database.
There are only a few tags available for each account, but considering the nearly-infinite space for each tag, just a couple of tags are enough to gather an enormous amount of information about your users and set up very complex targeting patterns.

Types of Tags

    Integer — used for the integer data (amount of in-game cash acquired, level achieved, age).
    String — used for string values (username, e-mail, identifiers).
    List — the same as String type, but each user may have multiple values set simultaneously (music preferences, news categories, cuisine preferences).
    Boolean — true / false type of Tag.
    Date — used for calendar dates. Basically, this is an integer type tag which stores Unix Epoch timestamps (automatically converted from/into Gregorian date).
    Price — allows to set values according to specified currency in the “*.XX” format (https://en.wikipedia.org/wiki/ISO_4217).
    Version — used for versioning. The example of allowed format is w.x.y.z (Major.Minor.Patch.Build). Max value for each version part is 9999, so the max version number cannot be greater than 9999.9999.9999.9999.

Tag operators

Each Tag type has a specific set of operators applicable. Tag operators define the relationship between the Tag and its values for segmentation purposes.
    Integer Tag operators: is, is not, are, not in, not set, any
    String Tag operators: is, is not, are, not in, not set, any
    List Tag operators: in, not in, not set, any
    Boolean Tag operators: is (true/false), not set, any
    Date Tag operators: exactly on, on or after, on or before, between, not set, any
    Price Tag operators: is, is not, greater or equals, less or equals, between, in, not in, not set, any
    Version Tag operators: is, is not, greater or equals, less or equals, between, in, not in, not set, any
"Not set" and "any" operators are available for all types of Tags.

Application Specific / Nonspecific Tags

This parameter describes tags’ behavior in relations to different apps in the same account. Application specific tags can have different sets of values for each app on the same account. Application nonspecific tags, on the contrary, store the same value for all apps that use this Tag.

Example

Let’s say you have two apps, a News app and a Game, and you want to target only those users who have explicitly agreed to receive pushes from you. So, you create a boolean tag called “Subscribed” and set "true" value for users who want to receive pushes from you, and "false" for those who don’t want to be notified.
One of your users, Anna, have installed both of your apps. She is okay with being notified about some breaking news, but opted out of any pushes from the Game app.
If the “Subscribed” tag is application specific, everything will go as planned. However, in case this tag was application nonspecific, then each of your apps will overwrite the value set by another app, which can ruin your targeting and cause frustration.
On the other hand, application nonspecific tags might come in handy if you want to perform cross-application targeting and trace users who have the same username in different applications.

Default Tags

These tags are available by Pushwoosh out-of-the-box, so you don’t have to (and, in fact, should not) set them manually. Most of them are set from the application and sent over to our server via registerDevice and other API calls, and some are set by the server itself.
Name
Type
Where it's set
Description
Application Version
Version
SDK
Current version of the app installed on a device
City
String
Server
Latest registered geographical location of a device
Country
String
Server
Latest registered geographical location of a device
Device Model
String
SDK
Indicates the device model whereon the app is installed
First Install
Date
Server
Indicates the time when a device was registered for notifications for the first time
In-App Product
List
SDK
The in-app products purchased by a user of the app
Last In-App Purchase Date
Date
SDK
The date of the latest in-app purchase made on a device
Jailbroken
Integer
SDK
Indicates whether a device is clean (value = 0) or jailbroken/rooted (value = 1)
Language
String
SDK
Two-letter lowercase abbreviation of a device's locale according to ISO-639-1; taken from device settings
Last Application Open
Date
Server
The time of the most recent app launch on a device
OS Version
Version
SDK
The version of an operating system running on a device
Push Alerts Enabled
Boolean
SDK
Indicates whether push alerts are allowed in device settings
SDK Version
Version
SDK
The version of the Pushwoosh SDK implemented on a device
Unsubscribed Emails
Boolean
SDK
Indicates whether a user has unsubscribed from receiving emails from your app

Custom Tags

This is where your creativity comes in to achieve your specific business goals. Custom tags can be created based on the segmentation logic or targeting pattern that is appropriate for your unique business needs.

How to set up a custom tag

    1.
    Go to the Tags page of your Control Panel and click "Add tag".
    2.
    Name your tag, pick the type, and decide whether it should be app-specific or not.
    3.
    Click "Save Tag".
That's it, now your custom tag is ready to collect information from your end-users. Let's see how it can be done.
This example involves setTags function used in PhoneGap / Cordova SDK
    1.
    Implement Pushwoosh SDK into your project as per our guides;
    2.
    Add the /setTags function:
1
//sets a string tag “username” with value “john” and integer tag “deviceId” with value 10
2
pushNotification.setTags({username:"john", deviceId:10},
3
function(status) {
4
console.warn('setTags success');
5
},
6
function(status) {
7
console.warn('setTags failed');
8
}
9
);
10
11
//sets a list tag "MyTag" with values "hello", "world"
12
pushNotification.setTags({"MyTag":["hello", "world"]});
Copied!
In 99% of cases, Tags are set from the application. Although it is possible to set tags via Remote API from your backend.

Using the default City tag

Device's location is determined based on its IP address at the moment your app was launched on that device for the last time. GeoIP submits the location data to Pushwoosh, and Pushwoosh saves the location received from GeoIP as a City tag value for a particular device.
In some cases, the location submitted by the GeoIP differs from the city name — for example, when it refers to an area of a city or other administrative unit. Please be careful when using the default City tag for segmentation purposes: make sure to select the proper values.
For example, if you're going to target users from Munich, you have to cover it with a bunch of City tag values, including "Munich" itself (with all the corresponding values, such as different variants of spelling which could be returned by GeoIP and saved as tag values) and several nearby areas.
When creating a Filter via Control Panel, use the map to choose all the needed locations.
Before creating a Filter via the API, check the values your users have on their devices via /getTagStats request.

Tags Statistics

Once your application sets Tag values, you can view and analyze the statistics about these values, presented in the Control Panel using either a pie chart, bar chart, or table view.

Creating Segments

Finally, we are all set to create our first targeted push! Having set up all the necessary tags that identify your target app users, we can now create a Segment and send a push notification to specific users.
Segments are pools of the app subscribers complying with the conditions you specify – those who have the specific tags' values assigned to their devices and/or user IDs.

Build Segment

To build a Segment by setting up the conditions (tags values to apply), go to the Segments (Filters) section of Pushwoosh Control Panel and press Create Segment button; then, choose the Build Segment option from the dropdown menu.
Enter the Filter's name and choose an app the Filter will be applied to.
Leave the "Application" field empty to create a Filter for all apps in your account.
Each Filter is described with Conditions which are Tags and values users have on their devices. To set Filter Conditions, choose a Tag from the drop-down menu:
Select a Tag operator from the list:
Type the Tag values in the corresponding field:
Each Filter can be described with several Conditions. To add a Condition, press the button:
To create Filters via API, please refer to the /createFilter API Reference section.

Import Segment

You can upload the CSV file to create a Segment of users with no need to specify filtering conditions.
The CSV file you’re uploading should contain UserIDs or HWIDs registered for the project you’re creating a Segment for. If the CSV file does not contain any User IDs or HWIDs, it won’t create any Segment. If User IDs or HWIDs contained in the CSV are not registered for the project, they will be skipped while importing the Segment.
Please make sure your CSV size is less than 100 MB.
In the Tags section, you can find the CSV import default tag. To all the user IDs or HWIDs contained in the CSV, the name of the CSV file is assigned as a value for that tag.
Processing the CSV file might take some time. You can leave the page; after the import is completed, the Segment will appear in the Segments list.
In the Segments list, you'll see the number of users in a Segment, the last time the Segment size was refreshed, and the conditions the Segment is built with.
To get the up-to-date Segment size, choose the Refresh Segment Size option of the three-dots menu. If you'd like to download the CSV of the segment, press Refresh & Export to CSV; when the CSV is ready to download, the download icon appears in the CSV column.
The downloaded CSV file will contain the Tag values assigned to every device in that segment, as well as Push Tokens and devices' types:
Hwid
Push Token
Type
Type (humanized)
Age
Application Version
City
Country
Device Model
Email Segment Name
First Install
Gender
In-app Product
In-app Purchase
Jailbroken
Language
Last Application Open
Last In-app Purchase date
Name
OS Version
PW Channels
Push Alerts Enabled
SDK Version
Subscription Segments
Unsubscribed Emails
WishList
146.....Hl23f
146.....Hl23f
10
Safari
27
us, new york
us
Safari 12.0.1
2020-02-19
en
2020-07-15
1
3.15.1.0
true
01D...3C8
eeeb2fd....fc3547
1
iOS
18
1.11.1.0
in, bengaluru
in
iPhone SE
2018-11-26
outwear_01
24
0
en
2018-11-26
2018-11-26
Anna
12.1.0.0
5.8.0.0
2D732-BB981, 7EC43-1531A
C90...79ae5
eQFKk......DwJSv
11
Chrome
36
us, chicago
us
Chrome 81
2020-08-24
en
2020-08-24
1
3.15.1.0

Sending Targeted Pushes

Now that you know how to do all the prep work for segmenting your audience, you’re all set to send highly targeted pushes to some of your users but not others. Remember, the more targeted your push notifications are, the more likely your audience will be to act on those pushes. Audience segmentation using Pushwoosh Tags and Filters is the key to effective user engagement and a powerful marketing strategy.
To send a one-time push notification to a Segment, press the Send Push button for the segment you'd like to target. You'll be taken to the One-time push section, where that segment is already selected in the Segmentation parameters.
To send targeted messages via API, please refer to the /createMessage or /createTargetedMessage API Reference section.
Last modified 2mo ago