6

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>
Pongpat
  • 13,248
  • 9
  • 38
  • 51

1 Answers1

19

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"
Pongpat
  • 13,248
  • 9
  • 38
  • 51
  • 1
    thanks for pointing this out. We'll update the doc as soon as we can. Please mark your answer as the correct solution so that other people who come to this page know what to do. – Avi May 05 '14 at 23:29
  • 5
    Thanks, can't believe Google still has not updated its documentation. Really bad doc :( – Hải Phong Jul 15 '14 at 14:17
  • 1
    Hi @GZ95 Thanks for pointing out the mistake in the doc, but it still doesn't work for me. Always get No Campaign Data found in the log. I've added the service and receiver in the manifest, that's it. Using your adb shell command with my app's package name in place of "com.example.gatestapp". Am i missing something? – Rahul Sainani Aug 19 '14 at 15:24
  • Have you look at Troubleshooting on this link https://developers.google.com/analytics/solutions/testing-play-campaigns – Pongpat Aug 19 '14 at 16:03
  • Yeah, thanks for replying. It worked after tinkering a bit with the link. I removed the space before --es, that's why it wasn't working. added the space, now it works. :) – Rahul Sainani Aug 19 '14 at 16:33
  • @droidster Good to hear that :) – Pongpat Aug 19 '14 at 18:00
  • 1
    In the current version of the doc, there are missing quotes on "referrer". Subtle but killing :) – Marina.Eariel Oct 29 '15 at 20:11