Tagging - Mobile SDK

Tagging - Mobile SDK

What is Tagging?

A tag is a label attached to someone or something for the purpose of identification or to give other information in order to target later.

The best use case for this feature is the preference lists on websites. Visitors may add themselves into lists according to their preferences to receive messages from your site or app.

In D·engage platform, you can set tags via

  • Web SDK
  • Mobile App

So you can set any tag for a key you choose using our Web SDK and Mobile SDKs.

Tagging can be used in 2 purposes:

  • Adding someone to a list
  • Assigning someone a property

Please see the example in the next section.

setTags[] function

This function is used to set a tag for a specific key. For Web SDK and Mobile SDK, the device id is assigned as Key. The function gets variable lists as a parameter list in order to set more than one tag at a time.

The object type of the array in the function is as follows:

{
"tag" : "string",
"value" : "string",
"changeTime" : "UTC date string",
"changeValue": "string",
"removeTime" : "UTC date string"
}

tag is the tag name you want to assign.

value is the value of your tag. Value of a tag can be empty.

changeTime is used to change the value of a tag after a period if needed. For instance, you may set a "new_member" tag for a specific customer for 1 day. So you may send the new_member as "yes" and then have the system change the value of the same tag 1 day later to "no". So you should put change_time (UTC) to define the time to change the value of the tag.

changeValue is used to change the value of the tag when change_time comes.

removeTime is used to remove tag off when this time comes.


var tags = [
{
"tag": "vip",
"value": "yes"
},
{
"tag": "recent_member",
"value": "yes"
},
{
"tag": "gender_may_be",
"value": "male"
},
{
"tag": "favorite_service",
"value": "news"
}
];

dengage("setTags", tags);

Code Examples


let tags = [
[
"tag": "tag1",
"value": "value1"
]
];

Dengage.setTags(tags);

let tags = [
[
"tag": "tag1",
"value": "value1",
"removeTime": "2021-03-08T11:57:39.211Z"
]
];

Dengage.setTags(tags);
ArrayList<> tags = new ArrayList<>();

HashMap<String, Object> item1 = new HashMap<>();
item1.put("tag", "tag1");
item1.put("value", "value1");
tags.add(item1);

DengageManager.getInstance(getApplicationContext()).setTags(tags);
var tags = [
{
"tag": "tag1",
"value": "value1"
}
];

dengage("setTags", tags);

var tags = [
{
"tag": "tag1",
"value": "value1",
"removeTime": "2021-03-08T11:57:39.211Z"
}
];

dengage("setTags", tags);
    • Related Articles

    • Tagging - Web SDK

      What is Tagging? A tag is a label attached to someone or something for the purpose of identification or to give other information in order to target later. The best use case for this feature is the preference lists on websites. Visitors may add ...
    • iOS SDK Setup

      Requirements D·engage Integration Key iOS Push Certificate iOS Device (you need to test on a real device for notifications) A Mac with the latest Xcode iOS version 10 or later (supported by D·engage Mobile SDK) Integration Methods CocoaPods ...
    • New Android SDK

      SDK Setup Requirements Minimum Android version supported 19+ SDK Installation Dengage SDK is available on JitPack package repository. If you haven't done so yet, add the JitPack repository in your project's build.gradle file: Groovy buildscript { ...
    • New iOS SDK Setup

      SDK Setup Requirements Minimum iOS version supported 11.0 SDK Installation CocoaPods Integration Dengage is available through CocoaPods. To install it, simply add the following line to your Podfile: Ruby pod 'Dengage', '~> 5.89' Run pod install via ...
    • (Old iOS Version) - Implementing the SDK

      Implementing Mobile SDK for IOS requires the steps below Setting Integration Key Integration Key is generated by CDMP Platform while defining application. It is a hash string that contains information about the application. At the beginning of your ...