注册一个google账号,如果你已经有,请略过
登录到这个网址中,我的电脑可以访问,最近难道不用翻墙了?
https://www.google.com/analytics/
申请一个appkey
新建一个app,同时获取对应的app key,接下来你的项目中将会用到的
<!-- Used for Google Play Store Campaign Measurement-->
<service android:name="com.google.android.gms.analytics.CampaignTrackingService" />
<receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:exported="true"
android:permission="android.permission.INSTALL_PACKAGES">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
mTracker = GoogleAnalytics.getInstance(this).newTracker("**-********-*");//你申请的APP key
GoogleAnalytics.getInstance(this).setDryRun(true);
GoogleAnalytics.getInstance(this).getLogger().setLogLevel(com.google.android.gms.analytics.Logger.LogLevel.VERBOSE);
// [START custom_event]
mTracker.send(new HitBuilders.EventBuilder()
.setCategory("Action")
.setAction("appProcessStart")
.build());
// [END custom_event]