Google Analytics Android SDK: Tracking the name of my application version and device model

I would like to track the version number of my application using the Google Analytics Android SDK and the model name of the device for people connecting to my application; What is the best way to achieve this?

I suppose I could do something like:

Device Model Name:

tracker.trackPageView ("/ testApplicationHomeScreen /" + Build.MODEL);

Version Number:

tracker.trackPageView ("/ testApplicationHomeScreen /" + packageInfo.versionName);

Will this work, and is this the best way to achieve this, or should I use events?

+5
source share
3 answers

, sdk "" / "" "". :

Android- Google Analytics Android-

Google Analytics -

, , . , /, V2.1 , URL- , /v 2.1.

, ( , ), sdk.

+4

, . , - .

.. "" "", . , , , .

+1

I successfully tracked application and application names using the following code:

GoogleAnalytics m_GaInstance = GoogleAnalytics.getInstance(this);

            m_GaTracker = m_GaInstance.getTracker("UA--");

        m_GaInstance.setDefaultTracker(m_GaTracker);
        m_GaTracker.setAppName("AppName");
        m_GaTracker.setAppVersion(m_appVersion);
+1
source

All Articles