Code Monkey home page Code Monkey logo

matomo-sdk-android's Introduction

Matomo SDK for Android

Build Codecov

Welcome to the Matomo Tracking SDK for Android. This library helps you send analytics data from Android apps to Matomo instances. Until v4 this library was known as Piwik Tracking SDK for Android.

Features:

Quickstart

For the not so quick start, see here or look at our demo app

  • Setup Matomo on your server.
  • Include the library in your app modules build.gradle file via JitPack
repositories {
  maven { url 'https://jitpack.io' }
}
dependencies {
  implementation 'com.github.matomo-org:matomo-sdk-android:<latest-version>'
}
  • Now you need to initialize your Tracker. It's recommended to store it as singleton. You can extend MatomoApplication or create and store a Tracker instance yourself:
import org.matomo.sdk.TrackerBuilder;

public class YourApplication extends Application {
    private Tracker tracker;
    public synchronized Tracker getTracker() {
        if (tracker == null){
            tracker = TrackerBuilder.createDefault("http://domain.tld/matomo.php", 1).build(Matomo.getInstance(this));
        }
        return tracker;
    }
}
  • The TrackHelper class is the easiest way to submit events to your tracker:
// The `Tracker` instance from the previous step
Tracker tracker = ((MatomoApplication) getApplication()).getTracker();
// Track a screen view
TrackHelper.track().screen("/activity_main/activity_settings").title("Settings").with(tracker);
// Monitor your app installs
TrackHelper.track().download().with(tracker);
  • Something not working? Check here.

License

Android SDK for Matomo is released under the BSD-3 Clause license, see LICENSE.

matomo-sdk-android's People

Contributors

d4rken avatar dotsbb avatar hannesa2 avatar dependabot[bot] avatar friederbluemle avatar kevinslashslash avatar eldk avatar tolriq avatar nasoym avatar fabiotacke avatar moopat avatar mohand1993 avatar starker3 avatar tsteur avatar alex0709 avatar koen20 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.