Skip to main content

mobilesdk

Bisko Android SDK

Version: 2.2.3


This service allows you to add Bisko to your Android app. This section of the documentation provides detailed steps on how to succesfully complete this task.

Requirements

ItemNotes
Android StudioDownload & Install Android Studio.
Android 4.4 (API 19)Your app must be leveraging at least this minimum OS version.

Adding the Bisko SDK


  1. From Android Studio, open your project.
  2. Open settings.gradle if you're using dependency resolution management. Otherwise, open a project-level build.gradle file.
  3. Add the necessary repositories.
repositories {
maven {
url 'https://pkgs.dev.azure.com/gjirafadev/GjirafaSpecs/_packaging/AndroidLibraries/maven/v1'
}
}
}
  1. Navigate to the build.gradle app level under the dependencies folder. Add the following code snippet.
build.gradle

implementation "tech.gjirafa:bisko:{TAG}"

NOTE

Replace {TAG} with the latest version of the Bisko SDK.

  1. Sync Gradle

You have now successfully added the Bisko SDK into your application

Setup


In order to complete the Bisko SDK import process, you must complete the following steps.

  1. Call Bisko.init() on your running activity.
//Initiation code for applications developed in kotlin
Bisko.init(context = this, propertyId = BISKO_PROPERTY_ID)
//Initiation code for applications developed in java
Bisko.Companion.init(this, BISKO_PROPERTY_ID);

Additionally you can send extra data which can be used to identify a user within different applications. For example, you can send additional IDs, or other user properties such as gender, age, group etc.

//Initiation code with user information for applications developed in kotlin
val userProps: HashMap<String, String> = HashMap()
userProps["Age"] = "33"
userProps["Gender"] = "Female"
Bisko.init(context = this, propertyId = BISKO_PROPERTY_ID, userId = "USER_ID_HERE", userProperties = userProps)
//Initiation code with user information for applications developed in java
Bisko.Companion.init(this, BISKO_PROPERTY_ID, "USER_ID_HERE", new HashMap<String, String>(){{ put("Age", "33"); put("Gender", "Male");}}, true);

As seen from the samples above the init() function expects five parameters:

PARAMETERDATATYPEREQUIREDDESCRIPTION
contextTRUEContext in which you'll use Bisko SDK.
propertyIdINTEGERTRUEThe identification number of you property created within your organization.
userIdSTRINGFALSEThe user identifier within your website.
userPropertiesHASHMAP<STRING,STRING>FALSEExtra user properties that you want to be added to the collected data.
useLocationBOOLEANFALSEUsed to specify whether to collect users GeoLocation information; Default value: true

Analytics


This section provides information on how to set up Bisko analytics for your Android app.

Implementing the delegate

The code snippets below provide information on how to execute this process using either Kotlin or Java.

Bisko.setDelegate(object : PushEventDelegate {
override fun onRequestStarted(body: String) {
// When request start with it's body
}

override fun onPushEventCompleted(success: Boolean, body: Any?, error: String) {
// Event response
}
})
Bisko.Companion.setDelegate(new PushEventDelegate() {
@Override
public void onRequestStarted(@NonNull String body) {
// When request start with it's body
}

@Override
public void onPushEventCompleted(boolean success, @Nullable Object body, @NonNull String error) {
// Event response
}
});

You can also listen for events in a class level. In order to do so, follow these instructions.

  1. On the onCreate() method of your fragment/activity, before invoking Bisko.init(), add the following code snippet.
Bisko.setDelegate(this)
Bisko.Companion.setDelegate(this);
  1. Implement the delegate on our class.
class YourKotlinActivity : AppCompatActivity(R.layout.your_layout), PushEventDelegate {
...
}
public class YourJavaActivity extends AppCompatActivity implements PushEventDelegate {
...
}
  1. Override the onRequestStarted() and onPushEventCompleted() methods.
override fun onRequestStarted(body: String) {
// When request start with it's body
}

override fun onPushEventCompleted(success: Boolean, body: Any?, error: String) {
// Event response
}
@Override
public void onRequestStarted(@NonNull String body) {
// When request start with it's body
}

@Override
public void onPushEventCompleted(boolean success, @Nullable Object body, @NonNull String error) {
// Event response
}

Event collection


Standard events are predefined user actions that correspond to common activities, such as reading an article, viewing a product, or watching a video.

All standard events are collected by calling one of the following methods.

  • Invoke Bisko.event() using JSONObject as content
ParameterDescription
typeYour event name
contentYour JSONObject with your content
  • Invoke Bisko.event() using HashMap as content
ParameterDescription
typeYour event name
eventsYour HashMap<String,Any> with your content

Collecting an event happening in the application can be as easy as the following:

// Kotlin
Bisko.event("contentView")
// Java
Bisko.Companion.event("contentView")

Since the event name is a string, you can send any text that covers your needs:

// Kotlin
Bisko.event("read")
Bisko.event("view")
Bisko.event("search")
Bisko.event("play")
// Java
Bisko.Companion.event("read")
Bisko.Companion.event("view")
Bisko.Companion.event("search")
Bisko.Companion.event("play")

IMPORTANT

The SDK must be initiated before you start collecting the events.

Event parameters


Standard events support properties, which allow you to include an object containing additional information about an event, such as ID, name, type, description etc.

The predefined properties that can be collected for the content where the event happened are:

PROPERTYDATATYPEDESCRIPTION
IdSTRINGThe identifier of the content.
NameSTRINGThe name of the content.
TypeSTRINGType of content, i.e. "video", "news article".
DescriptionSTRINGDescription of the content.
CategoryARRAYA string array of the content categories.
ImageUrlSTRINGThe url of the main image of the content.
ValueSTRINGValue of content, i.e. for ecommerce "100 $".
KeywordsARRAYA string array of keywords related to the content.
AuthorSTRINGThe author of the content.
QuantityINTEGERQuantity of the content.

All these properties are optional, so not sending any of them does not pose a problem.

In addition to the predefined properties mentioned above, custom properties that seem relevant to the event can be added to the content object.

IMPORTANT

All custom properties must be of type string


Bisko iOS SDK

Version: 1.1.0


This service allows you to add Bisko to your iOS application. This section of the documentation provides detailed steps on how to succesfully complete this task.

Requirements

ItemNotes
Xcode 9.0+Download and install Xcode.
iOS 10.0+The iOS operating system needs to be newer than 10.0.

Adding the Bisko SDK

The preferred method of installation is by using CocoaPods. You need to add the following code snippet to your Podfile:

pod 'BiskoSDK', :source => 'https://gjirafadev@dev.azure.com/gjirafadev/GjirafaSpecs/_git/GjirafaSpecs'

Then, run the following command:

pod install

To ensure that you have the latest version (1.0.28) of the SDK, run this command:

pod update 'BiskoSDK'

Setup


  1. Import BiskoSDK in your class where you are using Bisko

    import BiskoSDK
    #import <BiskoSDK/BiskoSDK.h>
  2. Call the Bisko.init()

    //Initiation code for applications developed in swift
    Bisko.init(propertyId: BISKO_PROPERTY_ID)
    //Initiation code for applications developed in objective C
    [[Bisko alloc] initWithPropertyId:BISKO_PROPERTY_ID];

    Additionally you can send extra data which can be used to identify a user within different applications. For example, you can send additional IDs, or other user properties such as gender, age, group etc.

        // Initiation code with user information for applications developed in swift
    Bisko.init(propertyId: BISKO_PROPERTY_ID, userId: "USER_ID_HERE", userProperties: ["Gender":"Female"])
        // Initiation code with user information for applications developed in swift
    [[Bisko alloc] initWithPropertyId: BISKO_PROPERTY_ID userId: "USER_ID_HERE" userProperties: userProperties];

As seen from the samples above the init() function expects five parameters:

PARAMETERDATATYPEREQUIREDDESCRIPTION
propertyIdINTEGERTRUEThe identification number of you property created within your organization.
userIdSTRINGFALSEThe user identifier within your website.
userProperties[STRING:STRING]FALSEExtra user properties that you want to be added to the collected data.

Event collection


In order to collect standard events in your application using Bisko, you must invoke the Bisko.event() function.

The simplest implementation of Bisko event collection can be as follows:

// Swift
Bisko.event(eventType: "contentView")
// Objective C
[Bisko eventWithEventType:@"contentView"];

Since the event name is a string, you can send any text that covers your needs:

Bisko.event(eventType: "read")
Bisko.event(eventType: "view")
Bisko.event(eventType: "search")
Bisko.event(eventType: "play")
// Objective C
[Bisko eventWithEventType:@"read"];
[Bisko eventWithEventType:@"view"];
[Bisko eventWithEventType:@"search"];
[Bisko eventWithEventType:@"play"];

IMPORTANT

The SDK must be initiated before you start collecting the events.

Event parameters


Standard events support properties, which allow you to include an object containing additional information about an event, such as ID, name, type, description etc.

The predefined properties that can be collected for the content where the event happened are:

PROPERTYDATATYPEDESCRIPTION
IdSTRINGThe identifier of the content.
NameSTRINGThe name of the content.
TypeSTRINGType of content, i.e. "video", "news article".
DescriptionSTRINGDescription of the content.
CategoryARRAYA string array of the content categories.
ImageUrlSTRINGThe url of the main image of the content.
ValueSTRINGValue of content, i.e. for ecommerce "100 $".
KeywordsARRAYA string array of keywords related to the content.
AuthorSTRINGThe author of the content.
QuantityINTEGERQuantity of the content.

All these properties are optional, so not sending any of them does not pose a problem.

In addition to the predefined properties mentioned above, custom properties that seem relevant to the event can be added to the content object.

IMPORTANT

All custom properties must be of type string

General examples


View without content

// Kotlin
Bisko.event("View")
// Java
Bisko.Companion.event("View");
// Swift
Bisko.event(eventType: "View")
// Objective C
[Bisko eventWithEventType:@"View"];

View with content

// Kotlin
var content = JSONObject()
content.put("id","321321312")
content.put("name","Content Name")
content.put("type","Content Type")
content.put("description","Content Description")
content.put("category",arrayListOf("Category","Subcategory 1","Subcategory 2"))
content.put("imageUrl","http://content.image/url")
content.put("value","Content Value")
content.put("keywords",arrayListOf("Keyword 1","Keyword 2","Keyword 3"))
content.put("author","Content Author")
content.put("quantity",1)

Bisko.event("View",content)
// Java
JSONObject content = new JSONObject();
content.put("id","321321312");
content.put("name","Content Name");
content.put("type","Content Type");
content.put("description","Content Description");
content.put("category",new ArrayList(Arrays.asList("Category","Subcategory 1","Subcategory 2")));
content.put("imageUrl","http://content.image/url");
content.put("value","Content Value");
content.put("keywords",new ArrayList(Arrays.asList("Keyword 1","Keyword 2","Keyword 3")));
content.put("author","Content Author");
content.put("quantity",1);

Bisko.Companion.event("View",content);
// Swift
var content : [String:Any] = [
"id": "321321312",
"name": "Content Name",
"type": "Content Type",
"description": "Content Description",
"category": [
"Category",
"Subcategory 1",
"Subcategory 2"
],
"imageUrl": "http://content.image/url",
"value": "Content Value",
"keywords": [
"Keyword 1",
"Keyword 2",
"Keyword 3"
],
"author": "Content Author",
"quantity": 1
]
Bisko.event(eventType: "View", content: content)
// Objective C
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
[content setObject:@"321321312" forKey:@"id"];
[content setObject:@"Content Name" forKey:@"name"];
[content setObject:@"Content Type" forKey:@"type"];
[content setObject:@"Content description" forKey:@"description"];
[content setObject:[NSArray arrayWithObjects:@"Category",@"Subcategory 1","Subcategory 2", nil] forKey:@"category"];[content setObject:@"http://content.image/url" forKey:@"imageUrl"];[content setObject:@"Content Value" forKey:@"value"];[content setObject:[NSArray arrayWithObjects:@"Keyword 1",@"Keyword 2","Keyword 3", nil] forKey:@"keywords"];
[content setObject:@"Content Author" forKey:@"author"];
[content setObject:@1 forKey:@"quantity"];

[Bisko eventWithEventType:@"View" content:content]

View with content(HashMap<String,Any?>?)

// Kotlin
var content = hashMapOf<String,Any?>()
content["id"] = "321321312"
content["name"] = "Content Name"
content["type"] = "Content Type"
content["description"] = "Content Description"
content["category"] = arrayListOf("Category","Subcategory 1","Subcategory 2")
content["imageUrl"] = "http://content.image/url"
content["value"] = "Content Value"
content["keywords"] = arrayListOf("Keyword 1","Keyword 2","Keyword 3")
content["author"] = "Content Author"
content["quantity"] = 1

Bisko.event("View",content)
// Java
HashMap<String, Object> content = new HashMap<>();
content.put("id","321321312");
content.put("name","Content Name");
content.put("type","Content Type");
content.put("description","Content Description");
content.put("category",new ArrayList(Arrays.asList("Category","Subcategory 1","Subcategory 2"));
content.put("imageUrl","http://content.image/url");
content.put("value","Content Value");
content.put("keywords",new ArrayList(Arrays.asList("Keyword 1","Keyword 2","Keyword 3"));
content.put("author","Content Author");
content.put("quantity",1);

Bisko.Companion.event("View", content);

Article event examples


In this section you can find some example code snippets for saving events related with articles in Bisko

// Kotlin
var content = hashMapOf<String,Any?>()
content["id"] = "1"
content["name"] = "Apple releases new iPhone version"
content["type"] = "article"
content["description"] = "Applce, Inc, has released the newset iPhone version for the users. It contains major changes and new features."
content["category"] = arrayListOf("Technology","Smartphone")
content["imageUrl"] = "https://magazine.com/apple-iphone-releas"
content["keywords"] = arrayListOf("apple","iphone","smartphone")
content["author"] = "James Smith"

Bisko.event("ArticleView",content)
// Java
HashMap<String, Object> content = new HashMap<>();
content.put("id","1");
content.put("name","Apple releases new iPhone version");
content.put("type","article");
content.put("description","Applce, Inc, has released the newset iPhone version for the users. It contains major changes and new features.");
content.put("category",new ArrayList(Arrays.asList("Technology","Smartphone"));
content.put("imageUrl","https://magazine.com/apple-iphone-releas");
content.put("keywords",new ArrayList(Arrays.asList("apple","iphone","smartphone"));
content.put("author","James Smith");

Bisko.Companion.event("ArticleView", content);
// Swift
var content : [String:Any] = [
"id": "1",
"name": "Apple releases new iPhone version",
"type": "article",
"description": "Applce, Inc, has released the newset iPhone version for the users. It contains major changes and new features.",
"category": [
"Technology",
"Smartphone"
],
"imageUrl": "https://magazine.com/apple-iphone-release",
"value": "Content Value",
"keywords": [
"apple",
"iphone",
"smartphone"
],
"author": "James Smith"
]

Bisko.event(eventType: "ArticleView", content: content)
// Objective C
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
[content setObject:@"1" forKey:@"id"];
[content setObject:@"Apple releases new iPhone version" forKey:@"name"];
[content setObject:@"article" forKey:@"type"];
[content setObject:@"Applce, Inc, has released the newset iPhone version for the users. It contains major changes and new features." forKey:@"description"];
[content setObject:[NSArray arrayWithObjects:@"Technology",@"Smartphone", nil] forKey:@"category"];
[content setObject:@"https://magazine.com/apple-iphone-releas" forKey:@"imageUrl"];
[content setObject:[NSArray arrayWithObjects:@"apple",@"iphone","smartphone", nil] forKey:@"keywords"];
[content setObject:@"James Smith" forKey:@"author"];

[Bisko eventWithEventType:@"ArticleView" content:content];

You can use the value property to save the value which is related with the specific event. For example we can use it to save the comment by the user.

// Kotlin
var content = hashMapOf<String,Any?>()
content["id"] = "1234"
content["name"] = "Samsung releases new Galaxy Note version"
content["type"] = "article"
content["description"] = "Samsung has released the newset Galaxy Note version for the users. It contains major changes and new features."
content["value"] = "Amazing news! The new Galaxy Note looks perfect!" // you can send the content of the comment through this property for example
content["category"] = arrayListOf("Technology","Smartphone")
content["imageUrl"] = "https://magazine.com/samsung-galaxy-note-release"
content["keywords"] = arrayListOf("samsung","galaxy note","note","smartphone")
content["author"] = "Nick Smith"

Bisko.event("ArticleComment",content)
// Java
HashMap<String, Object> content = new HashMap<>();
content.put("id","1234");
content.put("name","Samsung releases new Galaxy Note version");
content.put("type","article");
content.put("description","Samsung has released the newset Galaxy Note version for the users. It contains major changes and new features.");
content.put("value","Amazing news! The new Galaxy Note looks perfect!");//you can send the content of the comment through this property for example
content.put("category",new ArrayList(Arrays.asList("Technology","Smartphone"));
content.put("imageUrl","https://magazine.com/samsung-galaxy-note-release");
content.put("keywords",new ArrayList(Arrays.asList("samsung","galaxy note","note","smartphone"));
content.put("author","Nick Smith");

Bisko.Companion.event("ArticleComment", content);
// Swift
var content : [String:Any] = [
"id": "1234",
"name": "Samsung releases new Galaxy Note version",
"type": "article",
"description": "Samsung has released the newset Galaxy Note version for the users. It contains major changes and new features.",
"value": "Amazing news! The new Galaxy Note looks perfect!", //you can send the content of the comment through this property for example
"category": [
"Technology",
"Smartphone"
],
"imageUrl": "https://magazine.com/samsung-galaxy-note-release",
"value": "Content Value",
"keywords": [
"samsung",
"galaxy note",
"note",
"smartphone"
],
"author": "Nick Smith"
]

Bisko.event(eventType: "ArticleComment", content: content)
// Objective C
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
[content setObject:@"1234" forKey:@"id"];
[content setObject:@"Samsung releases new Galaxy Note version" forKey:@"name"];
[content setObject:@"article" forKey:@"type"];
[content setObject:@"Samsung has released the newset Galaxy Note version for the users. It contains major changes and new features." forKey:@"description"];
[content setObject:@"Amazing news! The new Galaxy Note looks perfect!" forKey:@"value"];//you can send the content of the comment through this property for example
[content setObject:[NSArray arrayWithObjects:@"Technology",@"Smartphone", nil] forKey:@"category"];
[content setObject:@"https://magazine.com/samsung-galaxy-note-release" forKey:@"imageUrl"];
[content setObject:[NSArray arrayWithObjects:@"samsung",@"galaxy note","note","smartphone", nil] forKey:@"keywords"];
[content setObject:@"Nick Smith" forKey:@"author"];

[Bisko eventWithEventType:@"ArticleComment" content:content];

You can send additional properties as part of the content which can give extra information about the event. For example we can save number of words for the article as part of the article view event. You can name the custom paramters any way that you want and they have to be of type string.

// Kotlin
var content = hashMapOf<String,Any?>()
content["id"] = "1234"
content["name"] = "Samsung releases new Galaxy Note version"
content["type"] = "article"
content["description"] = "Samsung has released the newset Galaxy Note version for the users. It contains major changes and new features."
content["category"] = arrayListOf("Technology","Smartphone")
content["imageUrl"] = "https://magazine.com/samsung-galaxy-note-release"
content["keywords"] = arrayListOf("samsung","galaxy note","note","smartphone")
content["author"] = "Nick Smith"
content["nrOfWords"] = "452" // custom property

Bisko.event("ArticleView",content)
// Java
HashMap<String, Object> content = new HashMap<>();
content.put("id","1234");
content.put("name","Samsung releases new Galaxy Note version");
content.put("type","article");
content.put("description","Samsung has released the newset Galaxy Note version for the users. It contains major changes and new features.");
content.put("category",new ArrayList(Arrays.asList("Technology","Smartphone"));
content.put("imageUrl","https://magazine.com/samsung-galaxy-note-release");
content.put("keywords",new ArrayList(Arrays.asList("samsung","galaxy note","note","smartphone"));
content.put("author","Nick Smith");
content.put("nrOfWords","452");//custom property

Bisko.Companion.event("ArticleView", content);
// Swift
var content : [String:Any] = [
"id": "1234",
"name": "Samsung releases new Galaxy Note version",
"type": "article",
"description": "Samsung has released the newset Galaxy Note version for the users. It contains major changes and new features.","value": "Amazing news! The new Galaxy Note looks perfect!", //you can send the content of the comment through this property for example
"category": [
"Technology",
"Smartphone",
],
"imageUrl": "https://magazine.com/samsung-galaxy-note-release",
"value": "Content Value",
"keywords": [
"samsung",
"galaxy note",
"note",
"smartphone"
],
"author": "Nick Smith",
"nrOfWords": "452" //custom property
]

Bisko.event(eventType: "ArticleView", content: content)
// Objective C
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
[content setObject:@"1234" forKey:@"id"];
[content setObject:@"Samsung releases new Galaxy Note version" forKey:@"name"];
[content setObject:@"article" forKey:@"type"];
[content setObject:@"Samsung has released the newset Galaxy Note version for the users. It contains major changes and new features." forKey:@"description"];
[content setObject:[NSArray arrayWithObjects:@"Technology",@"Smartphone", nil] forKey:@"category"];
[content setObject:@"https://magazine.com/samsung-galaxy-note-release" forKey:@"imageUrl"];
[content setObject:[NSArray arrayWithObjects:@"samsung",@"galaxy note","note","smartphone", nil] forKey:@"keywords"];
[content setObject:@"Nick Smith" forKey:@"author"];
[content setObject:@452 forKey:@"nrOfWords"]; //custom property

[Bisko eventWithEventType:@"ArticleView" content:content]

Video event examples


In this section you can find some example code snippets for saving events related with videos in Bisko

// Kotlin
var content = hashMapOf<String,Any?>()
content["id"] = "1"
content["name"] = "SpaceX rocket launch"
content["type"] = "video"
content["description"] = "SpaceX lanunches a new rocket to the orbit."
content["category"] = arrayListOf("Science","Aerospace")
content["imageUrl"] = "https://magazine.com/spacex-rocket-launch"
content["keywords"] = arrayListOf("spacex","orbit","nasa")
content["author"] = "William Smith"

Bisko.event("VideoView",content)
// Java
HashMap<String, Object> content = new HashMap<>();
content.put("id","1");
content.put("name","SpaceX rocket launch");
content.put("type","video");
content.put("description","SpaceX lanunches a new rocket to the orbit.");
content.put("category",new ArrayList(Arrays.asList("Science","Aerospace"));
content.put("imageUrl","https://magazine.com/spacex-rocket-launch");
content.put("keywords",new ArrayList(Arrays.asList("spacex","orbit","nasa"));
content.put("author","William Smith");

Bisko.Companion.event("VideoView", content);
// Swift
var content : [String:Any] = [
"id": "1",
"name": "SpaceX rocket launch",
"type": "video",
"description": "SpaceX lanunches a new rocket to the orbit.",
"category": [
"Science",
"Aerospace",
],
"imageUrl": "https://magazine.com/spacex-rocket-launch",
"keywords": [
"spacex",
"orbit",
"nasa"
],
"author": "William Smith"
]

Bisko.event(eventType: "VideoView", content: content)
// Objective C
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
[content setObject:@"1" forKey:@"id"];
[content setObject:@"SpaceX rocket launch" forKey:@"name"];
[content setObject:@"video" forKey:@"type"];
[content setObject:@"SpaceX lanunches a new rocket to the orbit." forKey:@"description"];
[content setObject:[NSArray arrayWithObjects:@"Science",@"Science", nil] forKey:@"category"];
[content setObject:@"https://magazine.com/spacex-rocket-launch" forKey:@"imageUrl"];
[content setObject:[NSArray arrayWithObjects:@"spacex",@"orbit","nasa", nil] forKey:@"keywords"];
[content setObject:@"William Smith" forKey:@"author"];

[Bisko eventWithEventType:@"VideoView" content:content];

Sending custom properties as part of the event:

// Kotlin
var content = hashMapOf<String,Any?>()
content["id"] = "1"
content["name"] = "SpaceX rocket launch"
content["type"] = "video"
content["description"] = "SpaceX lanunches a new rocket to the orbit."
content["category"] = arrayListOf("Science","Aerospace")
content["imageUrl"] = "https://magazine.com/spacex-rocket-launch"
content["keywords"] = arrayListOf("spacex","orbit","nasa")
content["author"] = "William Smith"
content["length"] = "1023" // custom property
content["serie"] = "SpaceX Launches" // custom property

Bisko.event("VideoView",content)
// Java
HashMap<String, Object> content = new HashMap<>();
content.put("id","1");
content.put("name","SpaceX rocket launch");
content.put("type","video");
content.put("description","SpaceX lanunches a new rocket to the orbit.");
content.put("category",new ArrayList(Arrays.asList("Science","Aerospace"));
content.put("imageUrl","https://magazine.com/spacex-rocket-launch");
content.put("keywords",new ArrayList(Arrays.asList("spacex","orbit","nasa"));
content.put("author","William Smith");
content.put("length","1023"); // custom property
content.put("serie","SpaceX Launches"); // custom property

Bisko.Companion.event("VideoView", content);
// Swift
var content : [String:Any] = [
"id": "1",
"name": "SpaceX rocket launch",
"type": "video",
"description": "SpaceX lanunches a new rocket to the orbit.",
"category": [
"Science",
"Aerospace",
],
"imageUrl": "https://magazine.com/spacex-rocket-launch",
"keywords": [
"spacex",
"orbit",
"nasa"
],
"author": "William Smith",
"length": "1023", //custom property
"serie": "SpaceX Launches" // custom property
]

Bisko.event(eventType: "VideoView", content: content)
// Objective C
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
[content setObject:@"1" forKey:@"id"];
[content setObject:@"SpaceX rocket launch" forKey:@"name"];
[content setObject:@"video" forKey:@"type"];
[content setObject:@"SpaceX lanunches a new rocket to the orbit." forKey:@"description"];
[content setObject:[NSArray arrayWithObjects:@"Science",@"Science", nil] forKey:@"category"];
[content setObject:@"https://magazine.com/spacex-rocket-launch" forKey:@"imageUrl"];
[content setObject:[NSArray arrayWithObjects:@"spacex",@"orbit","nasa", nil] forKey:@"keywords"];
[content setObject:@"William Smith" forKey:@"author"];
[content setObject:@"1023" forKey:@"length"]; // custom property
[content setObject:@"SpaceX Launches" forKey:@"serie"]; // custom property

[Bisko eventWithEventType:@"VideoView" content:content]

E-Commerce event examples


In this section you can find some example code snippets for saving events related with e-commerce in Bisko

// Kotlin
var content = hashMapOf<String,Any?>()
content["id"] = "1"
content["name"] = "Apple iPhone X, 64GB"
content["type"] = "product"
content["description"] = "IPhone X from Apple, 64GB of memory, Black."
content["category"] = arrayListOf("Mobile","Smartphones")
content["imageUrl"] = "https://image.com/iphone"
content["keywords"] = arrayListOf("apple","iphone x","black")
content["value"] = 954

Bisko.event("ProductView",content)
// Java
HashMap<String, Object> content = new HashMap<>();
content.put("id","1");
content.put("name","Apple iPhone X, 64GB");
content.put("type","product");
content.put("description","IPhone X from Apple, 64GB of memory, Black.");
content.put("category",new ArrayList(Arrays.asList("Mobile","Smartphones"));
content.put("imageUrl","https://image.com/iphone")
content.put("keywords",new ArrayList(Arrays.asList("apple","iphone x","black"));
content.put("value", 954);

Bisko.Companion.event("ProductView", content);
// Swift
var content : [String:Any] = [
"id": "1",
"name": "Apple iPhone X, 64GB",
"type": "product",
"description": "IPhone X from Apple, 64GB of memory, Black.",
"category": [
"Mobile",
"Smartphones",
],
"imageUrl": "https://image.com/iphone",
"keywords": [
"apple",
"iphone x",
"black"
],
"value": "954"
]

Bisko.event(eventType: "ProductView", content: content)
// Objective C
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
[content setObject:@"1" forKey:@"id"];
[content setObject:@"Apple iPhone X, 64GB" forKey:@"name"];
[content setObject:@"product" forKey:@"type"];
[content setObject:@"IPhone X from Apple, 64GB of memory, Black." forKey:@"description"];
[content setObject:[NSArray arrayWithObjects:@"Mobile",@"Smartphones", nil] forKey:@"category"];
[content setObject:@"https://image.com/iphone" forKey:@"imageUrl"];
[content setObject:[NSArray arrayWithObjects:@"apple",@"iphone x","black", nil] forKey:@"keywords"];
[content setObject:@954 forKey:@"value"];

[Bisko eventWithEventType:@"ProductView" content:content]

If more information is needed to be collected, as shown in previous examples custom properties can be used.

// Kotlin
var content = hashMapOf<String,Any?>()
content["id"] = "1"
content["name"] = "Apple iPhone X, 64GB"
content["type"] = "product"
content["description"] = "IPhone X from Apple, 64GB of memory, Black."
content["category"] = arrayListOf("Mobile","Smartphones")
content["imageUrl"] = "https://image.com/iphone"
content["keywords"] = arrayListOf("apple","iphone x","black")
content["quantity"] = 2
content["value"] = "1908"
content["unitprice"] = "954" // custom property
content["currency"] = "EUR" // custom property
content["brand"] = "Apple" // custom property
content["variant"] = "Black 64GB" // custom property
content["sku"] = "1299589" // custom property

Bisko.event("AddToCart",content)
// Java
HashMap<String, Object> content = new HashMap<>();
content.put("id","1");
content.put("name","Apple iPhone X, 64GB");
content.put("type","product");
content.put("description","IPhone X from Apple, 64GB of memory, Black.");
content.put("category",new ArrayList(Arrays.asList("Mobile","Smartphones"));
content.put("imageUrl","https://image.com/iphone")
content.put("keywords",new ArrayList(Arrays.asList("apple","iphone x","black"));
content.put("quantity",2);
content.put("value","1908");
content.put("unitprice","954"); // custom property
content.put("currency","EUR"); // custom property
content.put("brand","Apple"); // custom property
content.put("variant","Black 64GB"); // custom property
content.put("sku","1299589"); // custom property

Bisko.Companion.event("AddToCart", content);
// Swift
var content : [String:Any] = [
"id": "1",
"name": "Apple iPhone X, 64GB",
"type": "product",
"description": "IPhone X from Apple, 64GB of memory, Black.",
"category": [
"Mobile",
"Smartphones",
],
"imageUrl": "https://image.com/iphone",
"keywords": [
"apple",
"iphone x",
"black"
],
"value": "954",
"quantity": 2,
"value": "1908",
"unitprice": "954", // custom property
"currency": "EUR", // custom property
"brand": "Apple", // custom property
"variant": "Black 64GB", // custom property
"sku": "1299589" // custom property
]

Bisko.event(eventType: "AddToCart", content: content)
// Objective C
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
[content setObject:@"1" forKey:@"id"];
[content setObject:@"Apple iPhone X, 64GB" forKey:@"name"];
[content setObject:@"product" forKey:@"type"];
[content setObject:@"IPhone X from Apple, 64GB of memory, Black." forKey:@"description"];
[content setObject:[NSArray arrayWithObjects:@"Mobile",@"Smartphones", nil] forKey:@"category"];
[content setObject:@"https://image.com/iphone" forKey:@"imageUrl"];
[content setObject:[NSArray arrayWithObjects:@"apple",@"iphone x","black", nil] forKey:@"keywords"];
[content setObject:@2 forKey:@"quantity"];
[content setObject:@"1908" forKey:@"value"];
[content setObject:@"954" forKey:@"unitprice"]; // custom property
[content setObject:@"EUR" forKey:@"currency"]; // custom property
[content setObject:@"Apple" forKey:@"brand"]; // custom property
[content setObject:@"Black 64GB" forKey:@"variant"]; // custom property
[content setObject:@"1299589" forKey:@"sku"]; // custom property

[Bisko eventWithEventType:@"AddToCart" content:content]
// Kotlin
var content = hashMapOf<String,Any?>()
content["id"] = "1"
content["name"] = "Apple iPhone X, 64GB"
content["type"] = "product"
content["description"] = "IPhone X from Apple, 64GB of memory, Black."
content["category"] = arrayListOf("Mobile","Smartphones")
content["imageUrl"] = "https://image.com/iphone"
content["keywords"] = arrayListOf("apple","iphone x","black")
content["quantity"] = 2
content["value"] = "1908"
content["unitprice"] = "954" // custom property
content["currency"] = "EUR" // custom property
content["brand"] = "Apple" // custom property
content["variant"] = "Black 64GB" // custom property
content["sku"] = "1299589" // custom property
content["orderId"] = "123587" // custom property

Bisko.event("Purchase",content)
// Java
HashMap<String, Object> content = new HashMap<>();
content.put("id","1");
content.put("name","Apple iPhone X, 64GB");
content.put("type","product");
content.put("description","IPhone X from Apple, 64GB of memory, Black.");
content.put("category",new ArrayList(Arrays.asList("Mobile","Smartphones"));
content.put("imageUrl","https://image.com/iphone")
content.put("keywords",new ArrayList(Arrays.asList("apple","iphone x","black"));
content.put("quantity",2);
content.put("value","1908");
content.put("unitprice","954"); // custom property
content.put("currency","EUR"); // custom property
content.put("brand","Apple"); // custom property
content.put("variant","Black 64GB"); // custom property
content.put("sku","1299589"); // custom property
content.put("orderId","123587"); // custom property

Bisko.Companion.event("Purchase", content);
// Swift
var content : [String:Any] = [
"id": "1",
"name": "Apple iPhone X, 64GB",
"type": "product",
"description": "IPhone X from Apple, 64GB of memory, Black.",
"category": [
"Mobile",
"Smartphones",
],
"imageUrl": "https://image.com/iphone",
"keywords": [
"apple",
"iphone x",
"black"
],
"quantity": 2,
"value": "1908",
"unitprice": "954", // custom property
"currency": "EUR", // custom property
"brand": "Apple", // custom property
"variant": "Black 64GB", // custom property
"sku": "1299589", // custom property
"orderId": "123587" // custom property
]

Bisko.event(eventType: "Purchase", content: content)
// Objective C
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
[content setObject:@"1" forKey:@"id"];
[content setObject:@"Apple iPhone X, 64GB" forKey:@"name"];
[content setObject:@"product" forKey:@"type"];
[content setObject:@"IPhone X from Apple, 64GB of memory, Black." forKey:@"description"];
[content setObject:[NSArray arrayWithObjects:@"Mobile",@"Smartphones", nil] forKey:@"category"];
[content setObject:@"https://image.com/iphone" forKey:@"imageUrl"];
[content setObject:[NSArray arrayWithObjects:@"apple",@"iphone x","black", nil] forKey:@"keywords"];
[content setObject:@2 forKey:@"quantity"];
[content setObject:@"1908" forKey:@"value"];
[content setObject:@"954" forKey:@"unitprice"]; // custom property
[content setObject:@"EUR" forKey:@"currency"]; // custom property
[content setObject:@"Apple" forKey:@"brand"]; // custom property
[content setObject:@"Black 64GB" forKey:@"variant"]; // custom property
[content setObject:@"1299589" forKey:@"sku"]; // custom property
[content setObject:@"123587" forKey:@"orderId"]; // custom property

[Bisko eventWithEventType:@"Purchase" content:content]

Events that are not directly related to e-commerce can be collected to:

// Kotlin
var content = hashMapOf<String,Any?>()
content["type"] = "product"
content["category"] = arrayListOf("Mobile","Smartphones")
content["value"] = "samsung s10"

Bisko.event("Search",content)
// Java
HashMap<String, Object> content = new HashMap<>();
content.put("type","product");
content.put("category",new ArrayList(Arrays.asList("Mobile","Smartphones"));
content.put("value","samsung s10");

Bisko.Companion.event("Search", content);
// Swift
var content: [String: Any] = [
"type": "product",
"category": [
"Mobile",
"Smartphones"
],
"value": "samsung s10"
]

Bisko.event(eventType: "Search", content: content)
// Objective C
NSMutableDictionary *content = [[NSMutableDictionary alloc] init];
[content setObject:@"product" forKey:@"type"];
[content setObject:[NSArray arrayWithObjects:@"Mobile",@"Smartphones", nil] forKey:@"category"];
[content setObject:@"samsung s10" forKey:@"value"];

[Bisko eventWithEventType:@"Search" content:content];

Record collection

After creating a record, tracking code is generated in four different languages: Swift, Kotlin, Java and Objective-C to provide an easily event collecting process.

In this section you can find some example code snippets for saving MobileSDK events in Bisko in different languages:

// Swift
let payload : [String : Any] = [
"id": 1,
"name": "MacBookPro Laptop",
"type": "product",
"description": "White"
]
Bisko.record(alias: "recordAlias", payload: payload){ /* completionHandler */ }

The implementation of Bisko MobileSDK on record collection for ArticleViews would look like the following:

// Kotlin
var payload = hashMapOf<String,Any?>(
"siteId" to "SiteId value",
"pageId" to "PageId value",
"articleId" to "ArticleId value",
"articleTitle" to "ArticleTitle value",
"articleExcerpt" to "ArticleExcerpt value",
"articleTags" to arrayOf ("First value", "Second value", "Third value"),
"articleSections" to arrayOf ("First value", "Second value", "Third value"),
"articleMediaUrl" to "ArticleMediaUrl value",
"articlePublishDateTime" to "MM/dd/yyyy HH:mm:ss",
"articleAuthors" to arrayOf ("First value", "Second value", "Third value"),
"articleVersionId" to "ArticleVersionId value",
"articleLabels" to arrayOf ("First value", "Second value", "Third value"),
"articleReadingTime" to 1,
"articlePageIndex" to 1,
"articlePageAlias" to "ArticlePageAlias value",
"articlePages" to 1,
"articleWordsCount" to 1,
"articleCharactersCount" to 1,
"articleSentencesCount" to 1,
"sourcePage" to "SourcePage value",
"rootLayoutId" to "RootLayoutId value",
"rootLayoutVersionId" to "RootLayoutVersionId value",
"articleLayoutId" to "ArticleLayoutId value",
"articleLayoutVersionId" to "ArticleLayoutVersionId value",
"themeId" to "ThemeId value",
"themeVersionId" to "ThemeVersionId value"
)
Bisko.record(recordName = "articleViews", payload = payload, pushRecordDelegate = pushRecordDelegate)

The implementation of Bisko MobileSDK on record collection for Player would look like the following:

// Java
HashMap<String,Object> payload = new HashMap<>();
payload.put("playerId", 1);
payload.put("volume", 25);
payload.put("subtitleEnabled", true);
payload.put("displayScreen", "Normal");
payload.put("mode", "Theater Mode");
payload.put("autoplay", "ON");
payload.put("mute", false);

Bisko.Companion.record("player_action", payload, pushRecordDelegate);

The implementation of Bisko MobileSDK on record collection for E-commerce would look like the following:

// Objective-C
NSDictionary<NSString*, NSObject*> *payload = @{
@"id": @1,
@"name": @"Chanel perfume",
@"type": @"product",
@"description": @"In Parfum form, the fragrance full of contrast, with notes of Pink Pepper, Jasmine.",
@"category": [NSArray arrayWithObjects: @"Perfume", @"Fragrance", nil],
@"expirationDate": @"04/06/2022",
@"imageUrl": @"https://image.com/chanel",
@"keywords": [NSArray arrayWithObjects: @"chanel",@"chance", nil],
@"value": @140
};
[Bisko.recordWithAlias:@'product_view' payload: payload /* completionHandler */ { }]

Releases

Bisko Android SDK

Stable versions of Bisko Android SDK are:

VersionMain Features
2.2.3 (Current)Deprecated SSLFactory Method Fix
2.2.0Record Collection
2.1.3Event Collection

NOTE: To include 2.1.3 in your project in maven repositories this url should be used: https://pkgs.dev.azure.com/gjirafadev/_packaging/AndroidResources/maven/v1

Bisko IOS SDK

Stable versions of Bisko IOS SDK are:

VersionMain Features
1.1.0 (Current)Record Collection
1.0.39Event Collection