Skip to content

Commit

Permalink
Merge pull request #1 from dynamo-tommy/patch-2
Browse files Browse the repository at this point in the history
Changed readme.md markdown syntax to match newest Github markdown syntax
  • Loading branch information
dynamo-tommy committed Aug 23, 2018
2 parents 5802a46 + b3e8355 commit 0315a62
Showing 1 changed file with 59 additions and 55 deletions.
114 changes: 59 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@

### Kantar Sifo Mobile Analytics SDK for Android

- **[Overview][]**
- [What’s new?][]
- [SDK contents][]

- **[Getting started][]**
- [Basic parameters][]
- [Integration with Sifo Internet app][]

- **[Code implementation][]**
- [Basic functionality][]
- [Implementation steps ][]
- [Native apps][]
- [Options][]
- [Hybrid apps][]
- [Debugging][]
- [Debugging Threads][]
- [String encoding][]

- **[FAQ][]**
- **[Update strategy][]**
- **[Example files][]**
- **[Test application][]**
- **[Validation test with Kantar Sifo ][]**
- **[Contact information][]**


##Overview
- **[Overview](#overview)**
- [What’s new?](#whats-new)
- [SDK contents](#sdk-contents)

- **[Getting started](#getting-started)**
- [Basic parameters](#basic-parameters)
- [Integration with Sifo Internet app](#integration-with-sifo-internet-app)

- **[Code implementation](#code-implementation)**
- [Basic functionality](#basic-functionality)
- [Implementation steps ](#implementation-steps)
- [Native apps](#native-apps)
- [Options](#options)
- [Hybrid apps](#hybrid-apps)
- [Debugging](#debugging)
- [Debugging Threads](#debugging-threads)
- [String encoding](#string-encoding)

- **[FAQ](#faq)**
- **[Update strategy](#update-strategy)**
- **[Example files](#example-files)**
- **[Test application](#test-application)**
- **[Validation test with Kantar Sifo](#validation-test-with-kantar-sifo)**
- **[Contact information](#contact-information)**


# Overview

The Kantar Sifo Mobile Analytics SDK helps you to measure usage of mobile application using Kantar Sifo’s services. In order to measure traffic, your application needs to send HTTP requests to a server provided by Mobiletech or Codigo Analytics, using URL:s following a specified pattern with information about your application.

Expand All @@ -40,30 +40,30 @@ The SDK can help you with the whole process, both creating these URLs, as well a



###What’s new?
## What’s new?
Version 3 of this SDK is a major update which has been refactored and adapted to use modern Android standards. For example:

- Deprecated libraries for cookie handling and http connections have been replaced.
- Data is by default sent using https, with an option to use http if you prefer.
- A new sample application is included as source code and compiled apk file.
For more detailed changes of each version, see release-notes.txt in the SDK root folder.

###SDK contents
## SDK contents
The SDK contains the following:

- **Framework​**: The binary file that contains the API and functions to send tags in a
correct way. The file is called ​kantarsifo-mobileanalytics-3.X.X.aar.
- **TestApp**:​ An Android application that uses the framework and prints out logs when
sending tags. You can compare it to the logs printed by your own application to verify
your implementation. See also ​**[Test application][]** below.
your implementation. See also ​**[Test application](#test-application)** below.
- **Javadoc**:​ API documentation of public methods in the framework. Open index.html in
your web browser to view a complete specification of these classes and methods in
the framework.
- **Developer’s Guide.pdf​**: This document.



##Getting started
# Getting started
Follow the below steps to import the framework into your project.

- **Step 1:**​ Copy ​kantarsifo-mobileanalytics-3.X.X.aar file to the ​libs folder.
Expand Down Expand Up @@ -107,11 +107,11 @@ allprojects​ ​{
**Step 2:​** Add to dependency
```javascript
dependencies​ ​{
​implementation​ ​'com.github.kantarsifo:SifoInternetAndroidSDK:3.X.X
​implementation​ ​'com.github.kantarsifo:SifoInternetAndroidSDK:3.X.X'
}
```

###Basic parameters
## Basic parameters
- **Customer id​** (cpid - 4 digits or 32 characters)
This is your Customer ID provided by Kantar Sifo. This information will be included in the attribute called ​cpid​ in the tags sent to the server. Cpid can be one of two formats; Mobiletech IDs with 4 digits and Codigo IDs with 32 characters. The framework will automatically choose either Mobiletech or Codigo endpoints depending on the cpid.

Expand All @@ -127,18 +127,18 @@ The value current article, resource or content within the category that is being
- **Content Name​** (name) - optional ,contact sifo before use (max 255 characters)
The name of the current article, resource or content within the category that is being browsed.

##Integration with Sifo Internet app
Kantar Sifo collects information about how apps and websites are used in order to create for example statistics and insights for the app/website publisher. The software and service needed is made available once an agreement with Kantar Sifo is in place. The usage information captured can be associated with individuals in the Sifo Internet panel. The Sifo Internet panel consists of several thousand persons from the Sifo panel who have opted in to participate in the panel and install the Sifo Internet app on their mobile devices. For more information about the Sifo panel please go to: [https://www.kantarsifo.se/undersokningsdeltagare/sifopanelen]()
## Integration with Sifo Internet app
Kantar Sifo collects information about how apps and websites are used in order to create for example statistics and insights for the app/website publisher. The software and service needed is made available once an agreement with Kantar Sifo is in place. The usage information captured can be associated with individuals in the Sifo Internet panel. The Sifo Internet panel consists of several thousand persons from the Sifo panel who have opted in to participate in the panel and install the Sifo Internet app on their mobile devices. For more information about the Sifo panel please go to: [https://www.kantarsifo.se/undersokningsdeltagare/sifopanelen](https://www.kantarsifo.se/undersokningsdeltagare/sifopanelen)


Sifo Internet app integration is available to both WebView based apps and native apps. The purpose of this integration is to identify the user as a certain panelist. This is achieved by receiving a panelist Id string from the Sifo Internet app, and setting that Id as a cookie in your app’s shared CookieStore. This communication is handled by with:

- Install “Sifo Internet” app from Google Play Store.
- Login to app and stay logged in while running your app.

##Code implementation
# Code implementation

###Basic functionality
## Basic functionality

To get started with the tagging, you only need 4 methods.

Expand All @@ -147,7 +147,7 @@ To get started with the tagging, you only need 4 methods.
- For native apps, use **​sendTag​** to send a tag to the server when a view is shown in your application.
- For hybrid apps, use **​activateCookies​** to make a WebView automatically send tags when visiting webpages that have implemented tagging.

###Implementation steps
## Implementation steps

Initialize the framework by calling the ​createInstance​ method as shown below.
```javascript
Expand All @@ -163,7 +163,7 @@ TSMobileAnalytics.createInstance(​new​ TSMobileAnalytics.Builder(getApplicat
It can also be a good idea to make sure that **​createInstance​** does not return null, that means that something was wrong with your input data. If this happens you will also get an error print in the log.
Now use the following methods to send tags:

###Native apps
## Native apps
In the ​**onResume()** -method of any Activity or any other place where your application displays a view or page that should be tagged:

```javascript
Expand All @@ -190,11 +190,11 @@ if​ (TSMobileAnalytics.getInstance() != ​null​) {
... where **​categoryArray​** is an array of Strings specifying the category structure. A maximum of 4 categories are allowed in the structure, and their names must not be longer than 62 characters each.
If **​getInstance**() ​returns null, it means that **​createInstance​** has not been called. It would be a good idea to take some action if this happens. If you turned on debug prints in the framework using **​setLogPrintsActivated**(true)​ as described above, you can see if tags are being sent and received properly in the Android LogCat.

###Options
## Options

In addition to parameter category, you may use additional parameters. Please contact Kantar Sifo before doing that. **​contentID​** ​is a String with the identifier of the current content and **​contentName​** is a String with any other information that should be sent in the tag. Maximum length of these parameters are 255 characters.

###Hybrid apps
## Hybrid apps
In the **​onCreate**() ​method of any Activity with a WebView that should utilize the tags:
```javascript
if​ (TSMobileAnalytics.getInstance() !=null​) {
Expand All @@ -203,19 +203,19 @@ if​ (TSMobileAnalytics.getInstance() != ​null​) {
```
This method will allow third-party cookies.

###Debugging
## Debugging
There are several more advanced functions in the framework. The purpose of them is to help out if there are any problems or issues with the tagging that needs to be traced. It is possible to get information about pending requests, and to subscribe on notifications when a tag request has completed or failed, and more. To see some examples on how to use these functions, have a look at the source code for the test application.

###Debugging threads
## Debugging threads
The framework will take care of the threading for you, so you do not need to think about running the code in a separate thread.

###String encoding
## String encoding
Strings sent to the server will be encoded using UTF-8. If the string given to the framework contains characters that are not supported by this encoding, these characters will not be stored correctly in the statistics.

##FAQ
# FAQ

- **How do I test and verify that the framework is correct integrated?**
See ​[Test Application​]()​and [​Validation test with Kantar Sifo​]() below.
See ​[Test Application​](#test-application) and [​Validation test with Kantar Sifo​](#validation-test-with-kantar-sifo) below.
- **Native app - how do I integrate the framework​?**
You have to both initialize the framework and send “page view” events in a correct way. This is a difference to “hybrid app” where page tagging is implemented separate to the framework.
- **Hybrid app - how do I integrate the framework​?**
Expand All @@ -226,7 +226,7 @@ If the device has the Sifo Internet app installed and is logged in, Sifo Interne
- **Web TV / streaming - how shall we implement that​?**
Regarding web TV / streaming, it important to distinguish between measuring “preroll” and “start of clip”. Regarding what parameters to use, “preroll” shall not have the same category value as ​“**Start of clip​**”. As “start of clip” shall have **​“streaming”** as top category value, preroll can have e.g. “preroll” or “play”.

###Update strategy
# Update strategy

Updates of the framework will be necessary to fix bugs, add features, handle changes on the servers or platform etc. For this reason we want to make updating of the framework as easy and seamless as possible.

Expand All @@ -237,7 +237,7 @@ To keeping updating as seamless as possible it is important that you:
- Inform us as soon as you find something that should be changed or improved
- Inform us as soon as you find a bug, memory or performance issue

##Example files
# Example files
Below is a Java code example of how you can use the framework for Android.
```javascript
import​ se.kantarsifo.mobileanalytics.framework.TSMobileAnalytics;
Expand Down Expand Up @@ -287,19 +287,23 @@ class​ OtherActivity ​extends​ Activity { ​private​ String articleID;

For a more detailed example, please see the code for the test application.

##Test application
# Test application
The Android framework comes with an example application for you to test it with. The application will display a catalog structure with fake native content and real “hybrid content”. When a page or a category is browsed, the application will send a tag to the server with information. The application will print logs in the print log console called LogCat, which is included in the Android SDK, to show what information is sent and when.

If necessary, one could use tools to monitor network traffic, such as Charles Proxy or Fiddler, to verify that the network calls look ok.

##Validation test with Kantar Sifo
# Validation test with Kantar Sifo
Final step, contact Kantar Sifo (see contact info below) to verify that the sent tags have been correctly stored in the analytics databases.

##Contact information
Technical questions:
# Contact information
Technical questions:

[[email protected]]()

Other questions:
Other questions:

[[email protected]]()
[[email protected]]()
08-50742000

[[email protected]]()

08-50742000

0 comments on commit 0315a62

Please sign in to comment.