2014-02-12 89 views
7

我正在嘗試在Android中實施Google Analytics(分析)廣告系列跟蹤。我遵循這個指南:https://developers.google.com/analytics/devguides/collection/android/v2/campaignsGoogle Analytics(分析)廣告系列跟蹤未在報告中顯示

,這裏是我做了什麼:

將此添加到AndroidManifest:

<!-- Used for install referral measurement--> 
<service android:name="com.google.analytics.tracking.android.CampaignTrackingService"/> 
<receiver android:name="com.google.analytics.tracking.android.CampaignTrackingReceiver" android:exported="true"> 
    <intent-filter> 
    <action android:name="com.android.vending.INSTALL_REFERRER" /> 
    </intent-filter> 
</receiver> 

按照本指南(https://developers.google.com/analytics/solutions/testing-play-campaigns)進行廣播:

adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n com.my.app/com.google.analytics.tracking.android.CampaignTrackingReceiver --es "referrer" "utm_source%3Dtest_source%26utm_medium%3Dtest_medium%26utm_term%3Dtest_term%26utm_content%3Dtest_content%26utm_campaign%3Dtest_name" 

我檢查了logcat,它正確顯示這一行:

02-12 11:47:13.190: I/GAV3(18963): Thread[GAThread,5,main]: Campaign found: utm_source%3Dtest_source%26utm_medium%3Dtest_medium%26utm_term%3Dtest_term%26utm_content%3Dtest_content%26utm_campaign%3Dtest_name 

但是,它有另外2個額外的線路:

02-12 11:47:18.280: W/System.err(18963): [DEBUG] GbaRequest - GbaRequest: Constructor Called 222 userAgent Apache-HttpClient/UNAVAILABLE (java 1.4) 
02-12 11:47:18.280: W/System.err(18963): [DEBUG] NafRequest - NafRequest: NafRequest constructor===useragent Apache-HttpClient/UNAVAILABLE (java 1.4) 

,我收購下檢查的GA報告頁面 - >谷歌播放 - >源,它的只顯示(未設置),(無)或(直接),但不是sourcemedium,等我期待看到:test_sourcetest_medium

  • 注:我已經改變了日期的過濾器,以今天的日期,並有等了24小時,它仍然沒有顯示。

任何人都面臨這一點,知道如何解決?

+0

System.err日誌條目是由有人從代碼中調用System.err.println()引起的。這絕對不是Google Analytics(分析)。它可以是應用程序中遺留的調試代碼,也可以是鏈接庫中的錯誤。 – djabi

回答

0

Campaign接收器和服務已移至Google AnalyticsSDK的v2和v4版本之間的其他包名稱。這可能會導致問題。

在V2包是com.google.analytics.tracking.android:

com.google.analytics.tracking.android.CampaignTrackingReceiver 
com.google.analytics.tracking.android.CampaignTrackingService 

在V4的包com.google.android.gms.analytics:

com.google.android.gms.analytics.CampaignTrackingReceiver 
com.google.android.gms.analytics.CampaignTrackingService 

你應該請遵循v4而非v2的開發指南: https://developers.google.com/analytics/devguides/collection/android/v4/campaigns

相關問題