Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Campaign tracking not working after move to Google Play Services

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>
like image 911
Pongpat Avatar asked May 03 '14 20:05

Pongpat


1 Answers

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"
like image 63
Pongpat Avatar answered Sep 27 '22 19:09

Pongpat