Google Analytics for Android. Notified users are considered active.

I use Google Analytics in my applications and it works correctly. However, if I have, say, 100 active users daily, and then I send a notification, I have a peak of 1000 connected users considered "active".

I do not know if there is an easy way to prevent these users from being considered active. Most of them will not open the notification, and I do not want them to be considered active. I want to count only users who open the application, and not everyone who received a notification.

I use the body field in the notification I am sending, and in the application I create my own notification.

Can these “active” users be deleted?

Many thanks!

+6
source share
1 answer

Whenever your application receives a new notification, the Application method will be called OnCreate().

Not only a notification, even if you are subscribing to system events such as ACCESS_WIFI_STATE, ACCESS_NETWORK_STATE, RECEIVE_SMS, RECEIVE_BOOT_COMPLETED .. OnCreate () will be called.

Therefore, OnCreate()do not make any calls to Google Analytics within your application . This will initialize your GA and begin tracking events.

Remove Google Analytics-related codes within the application OnCreate()to prevent unwanted event tracking.

Update:

https://developers.google.com/analytics/devguides/collection/android/v4/advanced

getInstance ( )
GoogleAnalytics, .


; . , GoogleAnalytics, .

Application, mTracker .

// Inside Application class
private Tracker mTracker = null;
public synchronized Tracker getDefaultTracker() {
    if (mTracker == null) {
        // Prepare the GoogleAnalytics instance, only when it is needed.
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        mTracker = analytics.newTracker(Config.GA_TRACKING_ID);
        mTracker.enableAutoActivityTracking(true);
        mTracker.enableExceptionReporting(true);
        mTracker.setSessionTimeout(SESSION_TIMEOUT);
    }
    return mTracker;
}

, .

+2

All Articles