1 package com.moiseum.wolnelektury.utils;
3 import android.content.Context;
5 import com.moiseum.wolnelektury.base.WLApplication;
7 import org.piwik.sdk.Piwik;
8 import org.piwik.sdk.Tracker;
9 import org.piwik.sdk.TrackerConfig;
10 import org.piwik.sdk.extra.TrackHelper;
16 public final class TrackerUtils {
18 private static final String PIWIK_URL = "https://piwik.nowoczesnapolska.org.pl/nocas/piwik.php";
19 private static final String TRACKER_NAME = "MainTracker";
21 public static Tracker create(Context context) {
22 return Piwik.getInstance(context).newTracker(new TrackerConfig(PIWIK_URL, 29, TRACKER_NAME));
25 public static void trackScreen(String path, String name) {
26 Tracker tracker = WLApplication.getInstance().getTracker();
27 TrackHelper.track().screen(path).title(name).with(tracker);