I started measuring campaigns using Google Analytics V4, linking to https://developers.google.com/analytics/devguides/collection/android/v4/ . Before you test Campign Measurement, as described in https://developers.google.com/analytics/solutions/testing-play-campaigns . Every time my magazines show "No campaign data"
I imported Google Play services (Rev: 18) into my workspace and transferred it to my project
Added below lines in my manifest file
<uses-permission android:name="android.permission.INTERNET"></uses-permission> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <meta-data android:name="com.google.android.gms.analytics.globalConfigResource" android:resource="@xml/global_tracker" />
as well as below code
<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>
later created global_tracker.xml file under res-> xml. Below is my xml file
<?xml version="1.0" encoding="utf-8" ?> <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="TypographyDashes" > <integer name="ga_sessionTimeout">300</integer> <bool name="ga_autoActivityTracking">true</bool> <bool name="ga_debug">true</bool> <string name="ga_logLevel">verbose</string> <string name="ga_dryrun">true</string> <string name="ga_trackingId">UA-xxxxxxx-1</string> </resources>
replaced the tracking id with my tracking id
during testing campaign measurement, I first installed the application on my device (Moto G (4.4.2)) via adb install. Make sure that the application is not working and translates the intent, as indicated in the link above. I got a success log when an intent was broadcast.
Intention
E:\xxxxxxx\adt-bundle-windows-x86_64-20140321\sdk\platform-tools >adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n <My Package name>/com.google.android.gms.analytics.CampaignTrackingReceiver --es "referrer" "utm_source=testsource"
Answer:
Broadcasting: Intent { act=com.android.vending.INSTALL_REFERRER cmp=<My Package name> >/com.google.android.gms.analytics.CampaignTrackingReceiver (has extras) } Broadcast completed: result=0
When I opened my application, I always got " I / GAV2 (7342): Thread [GAThread, 5, main]: no data in the campaign. " In my logs.
Can someone tell me why I am not receiving campaign data? where am i wrong
Also, why does it show βGAV2β in the logs when I use GAV4
GA Magazines:
07-09 12:59:26.542: W/GAV2(20502): Thread[main,5,main]: Need to call initialize() and be in fallback mode to start dispatch. 07-09 12:59:31.568: I/GAV2(20502): Thread[GAThread,5,main]: No campaign data found.
Note. . This is the first time I've been working with Google Analytics. Since I want to check whether I receive campaign data or not, I have not implemented any trackers in GA
Edit: When I manually launch a broadcast intent when I click a button in my application. I can see the Campaign Found log when I restarted the application. But the same thing does not happen when triggered using the adb shell command, as described above. I doubt that I do not intend to get to my device. Is there any way to know if an intention is received or not?
Please, help