allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
implementation "com.github.blotoutio:edgetag-android:0.1.0"
The init
method is used for initializing SDK. This prepared all required configurations .
EdgeTag.INSTANCE.init(this, edgeTagConfiguration, new CompletionHandler())
applicationContext |
Object |
Application Context | |
edgeTagConfiguration |
EdgeTagConfiguration |
This Model contains information related to SDK initialization | |
comletionHandler |
CompletionHandler |
Required | Return callback for sdk success and failure |
setEndPointUrl |
String |
Required | Url where you will be sending data. |
disableConsentCheck |
Boolean |
Optional | default: false . Additional layer of consent that the developer can program in. |
EdgeTagConfiguration edgeTagConfiguration = new EdgetagConfiguration();
edgeTagConfiguration.setEndPointUrl("https://sdk-demo-t.edgetag.io");
EdgeTag.INSTANCE.init(this, edgeTagConfiguration, new CompletionHandler() {
@Override
public void onError(int code, String msg) {
}
@Override
public void onSuccess() {
}
});
The consent
method is used to record consent events. This allows you to send tag events to the server
consent( consentInfo:HashMap<String, Boolean>,comletionHandler())
consentInfo |
Object |
Optional | You can provide consent to this event. There is no limitation as this is just a key-value pair send to the server. |
comletionHandler |
CompletionHandler |
Required | Return callback for sdk success and failure |
HashMap<String,Object> consentInfo = new HashMap<>();
consentInfo.put("facebook","true");
EdgeTag.INSTANCE.consent(consentInfo,comletionHandler());
The tag
method is used to record events. This allows you to send tag events to the server
tag( eventName:String,eventInfo:HashMap<String, Any>?,providerInfo:HashMap<String, Boolean>?,comletionHandler())
eventName |
String |
Required | Name of the event that you are sending |
eventInfo |
Object |
Required | You can provide some additional data to this event. There is no limitation as this is just a key-value pair send to the server. |
providerInfo |
Object |
Optional | You can provide consent to this event |
comletionHandler |
CompletionHandler |
Return callback for sdk success and failure |
HashMap<String,Boolean> providerInfo = new HashMap<>();
providerInfo.put("facebook","true");
HashMap<String,Boolean> eventInfo = new HashMap<>();
eventInfo.put("facebook","capture");
EdgeTag.INSTANCE.tag("EventName ",eventInfo,providerInfo);
User data is quite important for conversion APIs. This API allows you to build your ID graph on the edge, which allows you to persist data. Note: User consent needs to be implemented to protect users.
user(key: String, value: String, completionHandler: CompletionHandler)
key |
String |
Required | Which user info are you sending. |
Allowed values: email, phone, firstName, lastName, gender, dateOfBirth, country, state, city, zip, address | |||
value |
String |
Required | Value that you would like to associate with the user key. |
comletionHandler |
CompletionHandler |
Required | Return callback for API success and failure |
EdgeTag.INSTANCE.user("email", "[email protected]", new CompletionHandler() {
@Override
public void onSuccess() {
}
@Override
public void onError(int code, String msg) {
}
});
Sometimes you would like to send more than one thing or store data that you would like to persist for the user's next visit. You can use this API if you would like to save multiple user records at the same time.
postData(data: HashMap<String, Any>, onComplete: OnComplete)
data |
HashMap<String, String> |
Required | Data that you would like to persist on the edge. |
onComplete |
OnComplete |
Required | Return callback for API success response and failure |
HashMap<String, Object> data = new HashMap<>();
data.put("email", "[email protected]");
data.put("value1", "1000");
data.put("currency", "USD");
data.put("newuser", "false");
EdgeTag.INSTANCE.postData(data, new OnComplete() {
@Override
public void onSuccess(@NonNull Object msg) {
}
@Override
public void onError(int code, @NonNull String msg) {
}
});
This API allows you to retrieve data from the edge storage that you send via user or data API.
getData(keys: ArrayList<String>, onComplete: OnComplete)
keys |
ArrayList |
Required | Keys that you would like to get value of from the edge. |
onComplete |
OnComplete |
Required | Return callback for API success response and failure |
ArrayList<String> key = new ArrayList<>();
key.add("email");
EdgeTag.INSTANCE.getData(key, new OnComplete() {
@Override
public void onSuccess(@NonNull Object msg) {
//return HashMap<String,String> or Empty Hashmap
}
@Override
public void onError(int code, @NonNull String msg) {
}
});
If you maybe forgot which keys you already sent to the edge to persist for the user, you can use this API to retrieve them.
getKeys(onComplete: OnComplete)
onComplete |
OnComplete |
Required | Return callback for API success response and failure |
EdgeTag.INSTANCE.getKeys(new OnComplete() {
@Override
public void onSuccess(@NonNull Object msg) {
//return JSON string or Empty Json
}
@Override
public void onError(int code, @NonNull String msg) {
}
});