Tags for push subscribers
Store your own key and value on a device, then build a segment that matches it.
A tag is a key and a value, both strings. Set one when you learn something about a user, then build segments from it.
Set and remove tags
Android
PushFyre.sendTag(context, "isPremium", "true")
PushFyre.sendTags(context, mapOf("plan" to "annual", "region" to "west"))
PushFyre.removeTag(context, "plan")
val current = PushFyre.tags(context)iOS
PushFyre.sendTag(key: "isPremium", value: "true")
PushFyre.sendTags(["plan": "annual", "region": "west"])
PushFyre.removeTag("plan")How tags are stored
Tags are saved on the device and re-sent every time it registers, so they survive restarts and token refreshes. Set them once when a value changes, rather than on every screen.
environment is reserved by the SDK. It marks an install as test or prod and cannot be set with a tag call.Use tags in segments
In the segment builder choose User Tag, enter the key and the value to match. See Segments.
When to set a tag
Set a tag when the fact changes, for example when a plan is purchased or a city is chosen. Setting the same tag on every screen writes the same value again. Remove a tag when the fact is no longer true, so a segment for isPremium does not keep someone who cancelled.
Values are strings, and a segment matches the key and the value exactly. Store yes or no as true and false and use that same spelling in the segment. Tags are saved on the device and sent again when the token refreshes, so you do not need to set them on every launch.