Question

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>
Was it helpful?

Solution

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"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top