1

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

1)我包含了最新的谷歌播放库项目。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

分析.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.
4

1 回答 1

0

我认为您应该查看测试跟踪活动文档中的故障排除章节

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

GoogleAnalytics.getInstance(this).getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
于 2015-06-01T11:31:21.690 回答