2

I am trying to setUp google analytics campaign measurements measurements .

here is what i did :

1. i've declared the receiver in the manifest file:

<!-- Enable Google Play Store Campaign reports -->
        <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
            android:exported="true"
            android:permission="android.permission.INSTALL_PACKAGES">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>
        <service
            android:name="com.google.android.gms.analytics.CampaignTrackingService"
            android:enabled="true" />
  1. I install the app on my device using this command:

    ./adb install debug.apk

  2. then i run this using my terminal , to broadcast the intent :

    ./adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n "com.mypackgename/com.google.android.gms.analytics.CampaignTrackingReceiver" --es referrer "utm_source=test2Source&utm_medium=testMedium&utm_term=testTerm&utm_content=testContent&utm_campaign=testCampaign"

which return this :

Broadcasting: Intent { act=com.android.vending.INSTALL_REFERRER cmp=com.mypackagename/com.google.android.gms.analytics.CampaignTrackingReceiver (has extras) }
Broadcast completed: result=0

but i got this in my log:

Thread[GAThread,5,main]: No campaign data found.

what should i do to make it work, i'v try a lot of things but without luck.

david
  • 3,310
  • 7
  • 36
  • 59

1 Answers1

0

You'll have to URL encode the arguments in the referrer string.

Please try the following:

./adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n "com.mypackgename/com.google.android.gms.analytics.CampaignTrackingReceiver" --es referrer "utm_source%3Dtest2Source%26utm_medium%3DtestMedium%26utm_term%3DtestTerm%26utm_content%3DtestContent%26utm_campaign%3DtestCampaign"

For more information check out: How to test android referral tracking?

Community
  • 1
  • 1
charleschenster
  • 252
  • 3
  • 8