跟踪推荐是否需要 GoogleAnalyticsTracker.getInstance()?

发布于 2024-09-14 03:14:25 字数 1112 浏览 8 评论 0 原文

我正在尝试跟踪人们是否通过广告或其他地方找到了我的 Android 应用程序。所以我发现谷歌分析可以通过这种形式生成的精心构造的网址来跟踪这一点:

http://code.google.com/mobile/analytics/docs/android/#android-market-tracking

看起来像这样:

http://market.android.com /search?q=pname:com.example.application&referrer=utm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3Dcampaign

...然后将分析 .jar 添加到我的项目中并将其添加到我的应用程序清单中:

<!-- Used for install referrer tracking -->
<receiver android:name="com.google.android.apps.analytics.AnalyticsReceiver" android:exported="true">
  <intent-filter>
    <action android:name="com.android.vending.INSTALL_REFERRER" />
  </intent-filter>
</receiver>

所以我的问题是:如果我想仅跟踪推荐而仅跟踪其他内容,我是否需要任何 GoogleAnalyticsTracker.*;我的活动中的代码?

I'm trying to track whether people have found my Android app from an ad, or elsewhere. So I found that google analytics can keep track of that via the carefully constructed url generated by this form:

http://code.google.com/mobile/analytics/docs/android/#android-market-tracking

which would look something like this:

http://market.android.com/search?q=pname:com.example.application&referrer=utm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3Dcampaign

...and then adding the analytics .jar to my project and adding this to my app's manifest:

<!-- Used for install referrer tracking -->
<receiver android:name="com.google.android.apps.analytics.AnalyticsReceiver" android:exported="true">
  <intent-filter>
    <action android:name="com.android.vending.INSTALL_REFERRER" />
  </intent-filter>
</receiver>

So my question is: if I want to track only referrals and nothing more, do I need any of the GoogleAnalyticsTracker.*; code in my activities?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愛放△進行李 2024-09-21 03:14:25

不,您不需要为此使用 GoogleAnalyticsTracker。

只需像这样创建您自己的 Tracker 类:

public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {

    Bundle extras = intent.getExtras();
    String referrerString = extras.getString("referrer");

    Log.w("TEST", "### INSTALL_REFERRER EVENT: " + intent.getAction());     
    Log.w("TEST", "### REFFERER IS: " + referrerString);
}
}

并将下一行添加到您的 AndroidManifest.xml 中

    <receiver android:name="MyReceiver" android:exported="true" >
      <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER" />
      </intent-filter>
    </receiver>

即可。

No, you don't need to use the GoogleAnalyticsTracker for that.

Just create your own Tracker class like that:

public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {

    Bundle extras = intent.getExtras();
    String referrerString = extras.getString("referrer");

    Log.w("TEST", "### INSTALL_REFERRER EVENT: " + intent.getAction());     
    Log.w("TEST", "### REFFERER IS: " + referrerString);
}
}

And also add next lines into your AndroidManifest.xml

    <receiver android:name="MyReceiver" android:exported="true" >
      <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER" />
      </intent-filter>
    </receiver>

That's it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文