Piwik SDK for Android
Welcome to the Piwik Tracking SDK for Android. Piwik is the leading open source web analytics platform that gives you valuable insights into your website's visitors, your marketing campaigns and much more, so you can optimize your strategy and experience of your visitors.
Quickstart
For the not so quick start, see here or look at our demo app
- Setup Piwik on your server.
- Include the library in your app modules
build.gradle
file
compile 'org.piwik.sdk:piwik-sdk:2.0.0'
- Ready your
Tracker
by extending ourPiwikApplication
class or do it yourself:
public class YourApplication extends Application {
private Tracker tracker;
public synchronized Tracker getTracker() {
if (tracker == null) tracker = Piwik.getInstance(this).newTracker(new TrackerConfig("http://domain.tld/piwik.php", 1));
return tracker;
}
}
- Done, your app is ready to use Piwik. Maybe start by tracking a screen view
Tracker tracker = ((PiwikApplication) getApplication()).getTracker();
TrackHelper.track().screen("/activity_main/activity_settings").title("Settings").with(tracker);
- or by monitoring your app installs
TrackHelper.track().download().with(tracker);
License
Android SDK for Piwik is released under the BSD-3 Clause license, see LICENSE.