Oracle Help Center | Oracle Push Cloud Service (Standalone) title

Advanced Segmentation

Push IO's SDKs provide metadata tracking (for iOS, Android, Windows Phone 8.1, and Windows UWP), which allows you to send push notifications in an even more fine-tuned and segmented manner.

Here's a list of current parameters that we track (the query you will use in the API and Quick Composer are in bold):

Function Console Log Output Composer/API Parameter
App Version appv = "int" $app_version
Library Version libv = "int" $library_version
OS Version osv = "int" $os_version
Timezone tz = "bin" $timezone
Carrier cr = "bin" $carrier
Locale l = "bin" $locale
UTC Offset utc = "int" $utc_offset
Device Model mod = "bin" $device_model
Device Manufacturer mf = "bin" $device_manufacturer
Updated At (Inactive User Metadata) Server Side $updated_at
Installed At ins = "int" $installed_at
User Identifier usr = "bin" $user_identifier

In addition, Latitude/Longitude and Device IDs (UUIDs) and Device Tokens can be sent to as well:

Latitude lat = "int" $latitude
Longitude lon = "int" $longitude
Device Token dt = "bin" $device_token
Device Identifier di = "bin" $device_identifier

Metadata is also tracked for these three types of phone attributes:

Screen Width w = "int" $screen_width
Screen Height h = "int" $screen_height
Screen Density d = "int" $screen_density

Setup/Integration:

No extra work is needed to begin tracking metadata parameters. Simply set up the Push IO Client Library as you normally would.

Pushing Based On Metadata:

Metadata can be combined with category and location queries to further segment your pushes. Metadata parameters act as their own categories preceded by a $ sign.

For example, this query will send a notification to those who have registered for a category (Pizza) and are registered for the timezone America/Denver: Pizza and $timezone = "America/Denver"

It would be formatted like this in the Push Composer:

"Example push based on metadata in Push Composer"

Supported Logic: AND, OR, NOT

Supported Operators: <, >, <=, >=, =, BETWEEN (min,max)

Supported Functions - these convert version strings and timestamp numbers into a representation that can be interpreted by our servers. Keep in mind that strings are wrapped with quotation marks (" ") whereas integers are not:

version("version_string") - Converts a version string into our internal representation so that it can be used in comparison operations. Example: version ("2.4.3")

days_ago(#days) - Builds a relative timestamp that represents the specified number of days ago. Example: days_ago(3)

weeks_ago(#weeks) - Builds a relative timestamp that represents the specified number of weeks ago. Example: weeks_ago(4)

months_ago(#months) - Builds a relative timestamp that represents the specified number of months ago. Example: months_ago(5)

parse_date("date_string") - Builds a timestamp for the date specified in the string. Example: parse_date("June 7th 1978"). It supports anything that Ruby's Date.parse function can handle.

Examples:

In this example, a notification will be sent to an application with its version being greater than 1.5: $app_version > version("1.5")

In this example, a notification will be sent to an application with its library version (Push IO Manager) being less than 2.9.3: $library_version < version("2.9.3")

In this example, a notification will be sent to an application with the device registered to the Denver, Phoenix, or Chicago timezones: $timezone = "America/Denver" or $timezone = "America/Phoenix" or $timezone = "America/Chicago"

In this example, a notification will be sent to an application with device registrations of the English, French, or German Locales: $locale = "en_US" or $locale = "de_DE" or $locale = "fr_US"

In these examples, a notification will be sent to an application that hasn't been opened in X amount of days, weeks, or months:

$updated_at < days_ago(28)

$updated_at < weeks_ago(4)

$updated_at < months_ago(1)

In this example, a notification will be sent to a device that falls BETWEEN two longitudes:

$longitude BETWEEN -106.281941,-100.281941

Pushing via API:

As mentioned, the Metadata parameters act as their own categories, which can be tapped into using the tag_query API parameter. Each metadata parameter is to be preceded by a $ sign.

NOTE: Strings are wrapped in quotation marks (" ") whereas integers are not. Likewise, the RESTful API supports these operators/logic:

Supported Logic: AND, OR, NOT

Supported Operators: <, >, <=, >=, =, BETWEEN (min,max)

Example 1: This cURL sends a notification to those registered for a latitude greater than zero and a longitude less than zero.

curl "https://api.pushio.com/api/v1/notify_app/[APP_ID]/[SENDER_SECRET]" -d 'payload={"message":"This Is A Test"}&tag_query=$latitude > 0 and $longitude < 0'

Example 2: This cURL sends a notification to those registered for the Sports category who are also registered for the en_US locale.

curl "https://api.pushio.com/api/v1/notify_app/[APP_ID]/[SENDER_SECRET]" -d 'payload={"message":"This Is Another Test"}&tag_query=Sports and $locale = "en_US"'

Example 3: This cURL sends a notification to those with en_US or de_DE locales who are also subscribed to the Soccer category.

curl "https://api.pushio.com/api/v1/notify_app/[APP_ID]/[SENDER_SECRET]" -d 'payload={"message":"This Is Another Test"}&tag_query=($locale ="en_US" or $locale = "de_DE") and Soccer'