Tracking User Details
Tracking User Profile Attributes
You can track a user’s profile attributes e.g., profileName, email etc.
To do this add the following code:
- Android(Java)
- iOS(obj-C)
- Unity(C#)
- C++
HashMap<String, String> userProfile = new HashMap<>();
userProfile.put("userAvatarURL", "avatar.jpeg");
userProfile.put("profileName","Bob");
userProfile.put("email", "bob@mail.com");
userProfile.put("phoneNumber", "555-3982");
userProfile.put("country", "US");
Wappier.getInstance().trackUserProfile(userProfile);
#import "WappierSDK.h"
[WappierSDK trackUserProfile:@{@"name":@"Player Name",
@"email":@"email@wappier.com",
@"any attribute name":@"any attribute value"
}];
Dictionary<string, string> userProfile = new Dictionary<string, string>()
{
{"name", "unity"},
{"surname", "gameengine"},
{"email", "unity@wappier.com"},
{"field_1", "field 1"},
{"field_2", "field 2"}
};
Wappier.Instance.TrackUserProfile(userProfile);
std::map<const char*, const char*> userProfile;
WappierSDKWrapper::getInstance()->trackUserProfile(userProfile);
note
You can use any number of attribute keys and values. User Profile attributes will be associated with the user’s document.
Adding or Removing tags from a User
Tags are associated with the user’s document and can be used for segmentation, targeting, and analytics. You can use any string as a tag.
To add or remove tags from a user, add the following code:
- Android(Java)
- iOS(obj-C)
- Unity(C#)
- C++
Wappier.getInstance().addTag("tag");
Wappier.getInstance().removeTag("tag");
#import "WappierSDK.h"
[WappierSDK trackTagAdded:tag];
[WappierSDK trackTagRemoved:tag];
Wappier.Instance.TrackTagAdded("tag");
Wappier.Instance.TrackTagRemoved("tag");
WappierSDKWrapper::getInstance()->trackTagAdded("tag");
WappierSDKWrapper::getInstance()->trackTagRemoved("tag");
Adding or Removing Key-Value pairs from a User
The Key-Value Pairs are associated with the user’s document and can be used for segmentation, targeting, and analytics.
To add or remove one or multiple Key-Value pair(s) from a user add the following code:
- Android(Java)
- iOS(obj-C)
- Unity(C#)
- C++
Wappier.getInstance().trackKVP("key","value");
or
HashMap<String, String> kvpMap = new HashMap<>();
kvpMap.put("key1","value1");
kvpMap.put("key2","value2");
kvpMap.put("key3","value3");
Wappier.getInstance().trackKVP(kvpMap);
#import "WappierSDK.h"
[WappierSDK trackKVPWithKey:@"key" andValue:@"value"];
or
[WappierSDK trackKVPWithDictionary:kvpDictionary];
Dictionary<string, string> kvpMap = new Dictionary<string, string>()
{
{"key1", "value1"},
{"key2", "value2"},
{"key3", "value3"}
};
Wappier.Instance.TrackKVP(kvpMap);
WappierSDKWrapper::getInstance()->trackKVP("key", "value");
or
std::map<const char*, const char*> kvpMap;
WappierSDKWrapper::getInstance()->trackKVP(kvpMap);
tip
The KVPs can be also sent as part of the startSession