如何设置Google Analytics分析广告系列衡量标准?安卓

时间:2015-12-21 16:14:12

标签: android android-studio google-analytics google-analytics-v4

我正在尝试设置Google搜索广告系列评估measurements

这就是我所做的:

1。 我在清单文件中声明了接收者:

<!-- Enable Google Play Store Campaign reports -->
        <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>
        <service
            android:name="com.google.android.gms.analytics.CampaignTrackingService"
            android:enabled="true" />
  1. 我使用此命令在我的设备上安装应用程序:

    ./ adb install debug.apk

  2. 然后我使用我的终端运行它来广播意图:

    ./ adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n&#34; com.mypackgename / com.google.android.gms.analytics.CampaignTrackingReceiver&#34; --es referrer&#34; utm_source = test2Source&amp; utm_medium = testMedium&amp; utm_term = testTerm&amp; utm_content = testContent&amp; utm_campaign = testCampaign&#34;

  3. 返回此:

    Broadcasting: Intent { act=com.android.vending.INSTALL_REFERRER cmp=com.mypackagename/com.google.android.gms.analytics.CampaignTrackingReceiver (has extras) }
    Broadcast completed: result=0
    

    但是我在日志中得到了这个:

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

    我该怎样做才能让它发挥作用,我会尝试很多事情,但没有运气。

1 个答案:

答案 0 :(得分:0)

您必须对引荐来源字符串中的参数进行URL编码。

请尝试以下方法:

  

./ adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n“com.mypackgename / com.google.android.gms.analytics.CampaignTrackingReceiver”--es referrer“utm_source%3Dtest2Source%26utm_medium%3DtestMedium% 26utm_term%3DtestTerm%26utm_content%3DtestContent%26utm_campaign%3DtestCampaign“

有关详细信息,请查看:How to test android referral tracking?