1

I am always getting "no campaign data found" error. Following is the steps that I followed. Please tell where I am wrong. I am using Android Studio.

1) I included latest google play library project.2) Added following lines in XML file

<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>

3) I added 2 files analytics.xml and global_tracker.xml in res/values

Analytics.xml

<?xml version="1.0" encoding="utf-8" ?>

<resources>
<!--Replace placeholder ID with your tracking ID-->
<string name="ga_trackingId">UA-******-1</string>

<!--Enable automatic activity tracking-->
<bool name="ga_autoActivityTracking">true</bool>
<string name="ga_logLevel">verbose</string>
<!--Enable automatic exception tracking-->
<bool name="ga_reportUncaughtExceptions">true</bool>

Global_tracker.xml

<?xml version="1.0" encoding="utf-8"?>

<!-- how often the dispatcher should fire -->
<integer name="ga_dispatchPeriod">30</integer>

<!-- Treat events as test events and don't send to google -->
<bool name="ga_dryRun">false</bool>

<!-- The screen names that will appear in reports -->
<string name="com.xyz.abc.def">My Activity</string>

Then I installed the app and fired following command

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

Then I saw following in logcat. Please tell where I am wrong

V/GAV4    (23030): Thread[GAThread,5,main]: connecting to Analytics service
V/GAV4    (23030): Thread[main,5,main]: service connected, binder: android.os.BinderProxy@49cf026
V/GAV4    (23030): Thread[main,5,main]: bound to service
V/GAV4    (23030): Thread[GAThread,5,main]: connect: bindService returned true for Intent { act=com.google.android.gms.analytics.service.START cmp=com.google.android.gms/.analytics.service.AnalyticsService (has extras) }
V/GAV4    (23030): Thread[main,5,main]: Connected to service
I/GAV4    (23030): Thread[GAThread,5,main]: No campaign data found.
Utkarsh Srivastav
  • 3,105
  • 7
  • 34
  • 53
  • Can you try broadcasting com.android.vending.INSTALL_REFERRER within 5 seconds of starting up the app? Also you can try restarting the app (you can kill the app process by dragging it out of the recent apps list) and look at the logcat. Did that helped? – djabi Jan 12 '15 at 05:33

1 Answers1

0

I think you should take a look on Troubleshooting chapter in Testing tracking campaign doc.

I think the most important is changing Google Analytics' log level to verbose, because without that you can't be 100% sure, that logs in logcat came from your app.

GoogleAnalytics.getInstance(this).getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
Krzysztof Skrzynecki
  • 2,345
  • 27
  • 39