我正在使用我的Android应用程序进行谷歌分析活动跟踪, 我不明白独特用户(只下载一次应用的用户)比用户(新用户和回访用户)更大。 这是一个屏幕截图:
编辑,这是我的android代码:清单:
<!-- Enable Google Play Store Campaign reports -->
<receiver
android:name=".analytics.CustomCampaignTrackingReceiver"
android:exported="true"
android:permission="android.permission.INSTALL_PACKAGES">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service
android:name="com.google.android.gms.analytics.CampaignTrackingService"
android:enabled="true" />
我的自定义接收器:
public class CustomCampaignTrackingReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
//get campaign url
String campaignUrl = intent.getStringExtra("referrer");
// Log.i("GAThread", "campaign Url:" + campaignUrl);
SharedStorage.defaultInstance(context).setCampaignTrackingUrl(campaignUrl);
// When you're done, pass the intent to the Google Analytics receiver.
new CampaignTrackingReceiver().onReceive(context, intent);
}
}
默认跟踪器:
private Tracker mTracker;
/**
* Gets the default {@link Tracker} for this {@link Application}.
*
* @return tracker
*/
synchronized public Tracker getDefaultTracker() {
if (mTracker == null) {
GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
analytics.setLocalDispatchPeriod(5);
//analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
// To enable debug logging use: adb shell setprop log.tag.GAv4 DEBUG
mTracker = analytics.newTracker("********");
}
String userId = Storage.getUserId(this);
if (userId != null)
mTracker.set("&uid", userId);
return mTracker;
}
在onResume和onPause活动中我发送open&amp;关闭应用程序事件:
onResume(){
getDefaultTracker().send(new HitBuilders.EventBuilder()
.setCategory(referrer)//category would be campaign tracking url
.setAction("openApp")
.setLabel(userId)
.build());
}
onPause(){
getDefaultTracker().send(new HitBuilders.EventBuilder()
.setCategory(referrer)//category would be campaign tracking url
.setAction("closeApp")
.setLabel(userId)
.build());
}