衡量移动应用程序的兼容性

时间:2015-07-30 09:34:26

标签: android google-analytics sdk

我正在尝试在深度链接到移动应用时衡量广告系列和流量来源,我正在关注本教程:https://developers.google.com/analytics/solutions/mobile-campaign-deep-link

我通过添加意图过滤器为我的应用内容启用了深层链接:

var delay = (function(){
  var timer = 0;
  return function(callback, ms){
    clearTimeout (timer);
    timer = setTimeout(callback, ms);
  };
})();

inputFilter.keyup(function() {
    delay(function(){
      var term = inputFilter.val().toLowerCase();

            listItems.each(function(i, e){
                var city = ($(e).text()).toLowerCase();

                if(city.startsWith(term)){
                    console.log(city);
                }
            });
    }, 800 );
});

之后,我标记了这样的网址:

  <application
    android:name="com.package.DeepLinkingapp.Myapp"
    android:allowBackup="true" android:label="@string/app_name"
    android:icon="@mipmap/ic_launcher" android:theme="@style/AppTheme">

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <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>
    <service android:name="com.google.android.gms.analytics.CampaignTrackingService" />
    <receiver android:name="com.google.android.gms.analytics.AnalyticsReceiver"
        android:enabled="true">
        <intent-filter>
            <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
        </intent-filter>
    </receiver>
    <service android:name="com.google.android.gms.analytics.AnalyticsService"
        android:enabled="true"
        android:exported="false"/>
    <activity
        android:name="com.package.DeepLinkingapp.MainActivity"
        android:label="@string/app_name" >
        <!-- this makes it available to the launcher -->
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <!-- this makes it openable with browser -->
        <!-- Accept chrome links -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:scheme="myscheme"
                android:host="deeplinking"
                android:pathPrefix="/"/>
        </intent-filter>
        <!-- Accept adb data flag -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:scheme="myscheme"
                android:host="deeplinking" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.package.DeepLinkingapp.LoginDisplayActivity"
        android:label="@string/title_activity_login_display" />

</application>

最后,我使用 onCreate 方法中的 setCampaignParamsFromUrl 方法将数据发送到GA:

myscheme://deeplinking?utm_medium=referral&utm_source=monsite&utm_campaign=apps

问题是我在界面GA中没有关于此广告系列的数据,我应该确切地说我已经在此页面中完成了测试:https://developers.google.com/analytics/solutions/testing-play-campaigns。它的工作原理只适用于来源:

Screen shot

你知道为什么我对Ga的竞选活动一无所知吗?我跳过了一些步骤吗?

非常感谢。

0 个答案:

没有答案