Search in sources :

Example 6 with GoogleAnalytics

use of com.google.android.gms.analytics.GoogleAnalytics in project routerkeygenAndroid by routerkeygen.

the class RouterKeygenApplication method getTracker.

/**
     * Gets the default {@link Tracker} for this {@link Application}.
     * @return tracker
     */
public synchronized Tracker getTracker() {
    if (mTracker == null) {
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        // To enable debug logging use: adb shell setprop log.tag.GAv4 DEBUG
        mTracker = analytics.newTracker(R.xml.analytics);
        mTracker.enableAdvertisingIdCollection(true);
    }
    return mTracker;
}
Also used : GoogleAnalytics(com.google.android.gms.analytics.GoogleAnalytics)

Example 7 with GoogleAnalytics

use of com.google.android.gms.analytics.GoogleAnalytics in project saga-android by AnandChowdhary.

the class ApplicationWrapper method getTracker.

synchronized Tracker getTracker(TrackerName trackerId) {
    if (!mTrackers.containsKey(trackerId)) {
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(PROPERTY_ID) : (trackerId == TrackerName.GLOBAL_TRACKER) ? analytics.newTracker(R.xml.global_tracker) : analytics.newTracker(R.xml.global_tracker);
        mTrackers.put(trackerId, t);
    }
    return mTrackers.get(trackerId);
}
Also used : GoogleAnalytics(com.google.android.gms.analytics.GoogleAnalytics) Tracker(com.google.android.gms.analytics.Tracker)

Example 8 with GoogleAnalytics

use of com.google.android.gms.analytics.GoogleAnalytics in project wh-app-android by WhiteHouse.

the class WHApp method configureAnalytics.

private void configureAnalytics() {
    if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(this) == SUCCESS) {
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        mAppTracker = analytics.newTracker(gov.whitehouse.R.xml.google_analytics);
        mAppTracker.enableAutoActivityTracking(true);
        mAppTracker.setAnonymizeIp(true);
    }
}
Also used : GoogleAnalytics(com.google.android.gms.analytics.GoogleAnalytics)

Aggregations

GoogleAnalytics (com.google.android.gms.analytics.GoogleAnalytics)8 Tracker (com.google.android.gms.analytics.Tracker)3 Provides (dagger.Provides)1 Map (java.util.Map)1 Singleton (javax.inject.Singleton)1