Android - Google analytics INSTALL_REFERRER not firing
Asked Answered
S

4

9

I'm trying to track my campaigns on google analytics, I've followed the tutorial but it is not working :( This is my manifest:

    <service android:name="com.google.android.gms.analytics.CampaignTrackingService" />
    <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>

When I try to test this and I send this command through the console it does nothing:

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

The only thing I see is that if I send it twice it says:

Ignoring duplicate install campaign

So I guess that the app receives the intent, apart from that, the app wakes when i send the intent.

The tutorial says that the app will log (if it is correct)

GAv4    : Received installation campaign: source=testSource

And if there is any problem:

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

But in my case it says nothing :(

Can anybody please help me??? Thanks!!

Sisto answered 24/4, 2016 at 15:25 Comment(3)
I'm dealing with the same issue, did you resolve it?Halutz
Facing same issue. Did you get any solution?Jackfruit
I'm also facing the exact problem. Did you get any solution.Av
E
3

Go to setting of your device, FORCE STOP the app and clear its data. Try again, it will work. The broadcast expect a fresh app install which is not run.

Eam answered 19/9, 2017 at 4:51 Comment(0)
F
1

Before sending the broadcast, you need to enable debugging:

adb shell setprop log.tag.GAv4 DEBUG

Otherwise you will not see the message "Received installation campaign".

Franky answered 17/8, 2016 at 7:44 Comment(0)
S
0

Your app must not be running. Just install the app but do not run it. See https://www.youtube.com/watch?v=DLx-7AgN1Jw at exactly [14:00]

Sheugh answered 9/5, 2017 at 7:7 Comment(0)
G
0

Uninstall app, if it is already installed. Then follow below steps.

  1. Install app using adb

    adb install yourapp.apk

  2. To enable debug logging on a device run:

    adb shell setprop log.tag.GAv4 DEBUG

    adb logcat -s GAv4

  3. Start broad casting

    adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n "com.example.gatestapp/com.google.android.gms.analytics.CampaignTrackingReceiver" --es "referrer" "utm_source=test_source&utm_medium=test_medium&utm_term=test_term&utm_content=test_content&utm_campaign=test_name"

Guanase answered 5/9, 2018 at 11:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.