After follow this https://developers.google.com/analytics/solutions/testing-play-campaigns
The logcat always report: No campaign data found.
Here's my AndroidManifest.xml
<!-- 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" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
After several hours of searching.
Finally, I found the answer by myself.
adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n
com.example.gatestapp/com.google.analytics.tracking.android.CampaignTrackingReceiver
--es "referrer" "utm_source=testSource&utm_medium=testMedium&utm_term=testTerm&utm_content=testContent&utm_campaign=testCampaign"
The document seem to use the code from old SDK.
You have to change from com.google.analytics.tracking.android.CampaignTrackingReceiver
to com.google.android.gms.analytics.CampaignTrackingReceiver
And this is what it will look like
adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n
com.example.gatestapp/com.google.android.gms.analytics.CampaignTrackingReceiver
--es "referrer" "utm_source=testSource&utm_medium=testMedium&utm_term=testTerm&utm_content=testContent&utm_campaign=testCampaign"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With