Google Analytics v4,未找到广告系列

时间:2015-01-08 17:24:51

标签: java android c++ google-analytics easytracker

我总是收到“未找到广告系列数据”错误。以下是我遵循的步骤。请告诉我哪里错了。我正在使用Android Studio。

1)我添加了最新的Google Play库项目.2)在XML文件中添加了以下行

<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)我在res / values

中添加了2个文件analytics.xml和global_tracker.xml

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>

然后我安装了应用程序并触发了以下命令

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"

然后我在logcat中看到了以下内容。请告诉我哪里错了

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.

1 个答案:

答案 0 :(得分:0)

我认为你应该看看Troubleshooting chapter in Testing tracking campaign doc

我认为最重要的是改变Google Analytics&#39;将日志级别设置为详细,因为没有它,您无法100%确定,logcat中的日志来自您的应用程序。

GoogleAnalytics.getInstance(this).getLogger().setLogLevel(Logger.LogLevel.VERBOSE);