Skip to content

You can tag users/devices from your SDK in one line of code.

The SDK looks after the details for the device, you just supply the tag key and value:

  • The tag name (key) is what you want to call it. In the example below "Plan-49" is how you will see this in the Contextual Dashboard.
  • Contextual supports tags of: string, numeric and datetime. In the example below, the value for "Plan-49" is "Trial-Period".

String Tags

1
   Contextual.tagString("ProductOffer", "Liked")
1

``` javascript // :TODO:

Numeric Tags

1
    Contextual.tagNumeric("BidValue", 549.99)
1

``` javascript // :TODO:

Datetime Tags

1
2
3
4
5
6
// Example code using custom tag
String key = "Birthday"
Contextual.tagDatetime(key, OffsetDate.now())
// Example code using user's current OffsetDateTime
String key = "Birthday"
Contextual.tagDatetime(key)
1

``` javascript // :TODO:

Other Tag Operations

Increment Tag Value

1
2
String key = "PageVisited"
Contextual.incrementTag(key)
1

``` javascript // :TODO:

Remove Tag

1
2
String key = "RemoveUser"
Contextual.removeTag(key)
1

``` javascript // :TODO:


Last update: 2024-02-07