<legend id='HlE58'><style id='HlE58'><dir id='HlE58'><q id='HlE58'></q></dir></style></legend>

  1. <tfoot id='HlE58'></tfoot>

    <i id='HlE58'><tr id='HlE58'><dt id='HlE58'><q id='HlE58'><span id='HlE58'><b id='HlE58'><form id='HlE58'><ins id='HlE58'></ins><ul id='HlE58'></ul><sub id='HlE58'></sub></form><legend id='HlE58'></legend><bdo id='HlE58'><pre id='HlE58'><center id='HlE58'></center></pre></bdo></b><th id='HlE58'></th></span></q></dt></tr></i><div id='HlE58'><tfoot id='HlE58'></tfoot><dl id='HlE58'><fieldset id='HlE58'></fieldset></dl></div>

  2. <small id='HlE58'></small><noframes id='HlE58'>

      • <bdo id='HlE58'></bdo><ul id='HlE58'></ul>

      获取 Android Google Analytics(分析)引荐来源网址标签

      Get Android Google Analytics referrer tag(获取 Android Google Analytics(分析)引荐来源网址标签)

            <tbody id='oUSm3'></tbody>

          <small id='oUSm3'></small><noframes id='oUSm3'>

          • <tfoot id='oUSm3'></tfoot>

            • <legend id='oUSm3'><style id='oUSm3'><dir id='oUSm3'><q id='oUSm3'></q></dir></style></legend>
              <i id='oUSm3'><tr id='oUSm3'><dt id='oUSm3'><q id='oUSm3'><span id='oUSm3'><b id='oUSm3'><form id='oUSm3'><ins id='oUSm3'></ins><ul id='oUSm3'></ul><sub id='oUSm3'></sub></form><legend id='oUSm3'></legend><bdo id='oUSm3'><pre id='oUSm3'><center id='oUSm3'></center></pre></bdo></b><th id='oUSm3'></th></span></q></dt></tr></i><div id='oUSm3'><tfoot id='oUSm3'></tfoot><dl id='oUSm3'><fieldset id='oUSm3'></fieldset></dl></div>
              • <bdo id='oUSm3'></bdo><ul id='oUSm3'></ul>

                本文介绍了获取 Android Google Analytics(分析)引荐来源网址标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我们计划使用 Google Analytics 来跟踪通过 Android Market 到我们应用程序的广告点击推荐.

                We're planning to use Google Analytics to track ad click-through referrals, through the Android Market, to our application.

                根据 Google 文档 referrer 标签是通过 Intent 传递的,并由 Google Analytics 库自动记录.

                According to the Google Documentation the referrer tag comes through via an intent, and is automatically recorded by the Google Analytics library.

                这很好,但我们需要提取该推荐标签以进行我们自己的内部分析.文档没有详细说明如何从初始启动意图中获取它,以及如何在上线之前模拟它的说明.

                That's great, but we need to extract that referral tag for our own internal analytics. The documentation is shy on details about how to grab it out of the initial launch intent, and instructions on how to simulate this before going live.

                有人有这方面的经验吗?

                Does anyone have experience with this?

                推荐答案

                我继续并发布了一个坏点查找器应用程序来玩窥探意图.出于某种原因,当我注册了两个不同的广播接收器(即 com.google.android.apps.analytics.AnalyticsReceiver 和我自己的)时,我自己从来没有收到过.

                I went ahead and published a dead pixel finder app to play with snooping on the intent. For some reason, when I registered two different broadcast receivers (ie com.google.android.apps.analytics.AnalyticsReceiver and my own), I never received it on my own.

                因此,我注册了我自己的接收器,处理信息,并将其传递给 Google Analytics.不知道这是多么洁净,但它有效.代码如下.

                So instead, I registered only my own receiver, process the information, and pass it along to Google Analytics. Don't know how kosher this is, but it works. Code follows.

                public class ZSGoogleInterceptor extends BroadcastReceiver {
                
                    @Override
                    public void onReceive(Context context, Intent intent) {
                        Bundle extras = intent.getExtras();
                
                        String referrerString = extras.getString("referrer");
                        // Next line uses my helper function to parse a query (eg "a=b&c=d") into key-value pairs
                        HashMap<String, String> getParams = Utility.getHashMapFromQuery(referrerString);
                        String source = getParams.get("utm_campaign");
                
                        if (source != null) {
                            SharedPreferences preferences = context.getSharedPreferences("my_prefs", Context.MODE_PRIVATE);
                            Editor preferencesEditor = preferences.edit();
                            preferencesEditor.putString("ga_campaign", source);
                            preferencesEditor.commit();
                        }
                
                        // Pass along to google
                        AnalyticsReceiver receiver = new AnalyticsReceiver();
                        receiver.onReceive(context, intent);
                    }
                
                }
                

                然后,当您的应用程序实际启动时,您可以将值从共享首选项中提取出来,并将其与用户注册或其他内容一起传递.我将广告系列标签用于我的目的,但您可以从创建的引荐来源字符串中获取任何您想要的参数 用这个工具.

                Then, when your application is actually launched, you can pull the value back out of the shared preferences and pass it along with user signup or whatever. I used the campaign tag for my purposes, but you can grab any parameters you want out of the referrer string created with this tool.

                这篇关于获取 Android Google Analytics(分析)引荐来源网址标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Android - Is it possible to get install referrer programmatically(Android - 是否有可能以编程方式安装引荐来源网址)
                How to sign an APK with more than one certificate?(如何使用多个证书签署 APK?)
                versionCode vs versionName in Android Manifest(Android Manifest 中的 versionCode 与 versionName)
                What does this Google Play APK publish error message mean?(这个 Google Play APK 发布错误消息是什么意思?)
                Lost my keystore for uploaded app on android market(丢失了我在 android 市场上上传的应用程序的密钥库)
                App on Google Play always shows quot;Updatequot; instead of open(Google Play 上的应用程序总是显示“更新;而不是打开)
                    <bdo id='E1Epj'></bdo><ul id='E1Epj'></ul>

                    <small id='E1Epj'></small><noframes id='E1Epj'>

                      <tbody id='E1Epj'></tbody>
                      <tfoot id='E1Epj'></tfoot>

                    • <legend id='E1Epj'><style id='E1Epj'><dir id='E1Epj'><q id='E1Epj'></q></dir></style></legend>
                        <i id='E1Epj'><tr id='E1Epj'><dt id='E1Epj'><q id='E1Epj'><span id='E1Epj'><b id='E1Epj'><form id='E1Epj'><ins id='E1Epj'></ins><ul id='E1Epj'></ul><sub id='E1Epj'></sub></form><legend id='E1Epj'></legend><bdo id='E1Epj'><pre id='E1Epj'><center id='E1Epj'></center></pre></bdo></b><th id='E1Epj'></th></span></q></dt></tr></i><div id='E1Epj'><tfoot id='E1Epj'></tfoot><dl id='E1Epj'><fieldset id='E1Epj'></fieldset></dl></div>