Reputation: 8815
I'm trying to implement Google Analytic campaign tracking in Android. I followed this guide: https://developers.google.com/analytics/devguides/collection/android/v2/campaigns
and here is what I've done:
Added this to 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>
Followed this guide (https://developers.google.com/analytics/solutions/testing-play-campaigns) to perform the broadcast:
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"
I checked the logcat, it's showing this line correctly:
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
However, it's having another 2 extra lines:
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)
and I checked the GA report page under Acquisition-->Google Play-->Sources, and it's only showing (not set), (none) or (direct), but not the source
, medium
, etc I'm expecting to see: test_source
, test_medium
, etc.
Anyone faces this and knows how to solve?
Upvotes: 7
Views: 1001
Reputation: 5767
The Campaign receiver and service have been moved to a different package name between v2 and v4 of Google Analytics SDK. This might be causing the problem.
In v2 the package is com.google.analytics.tracking.android:
com.google.analytics.tracking.android.CampaignTrackingReceiver
com.google.analytics.tracking.android.CampaignTrackingService
In v4 the package is com.google.android.gms.analytics:
com.google.android.gms.analytics.CampaignTrackingReceiver
com.google.android.gms.analytics.CampaignTrackingService
You should follow the dev guide from v4 instead of v2: https://developers.google.com/analytics/devguides/collection/android/v4/campaigns
Upvotes: 0