Android的转诊追踪不起作用 [英] Android referral tracking does not work
问题描述
我试图让机器人转诊追踪工作。我下面我在这里找到<一个唯一的文档href="http://$c$c.google.com/mobile/analytics/docs/android/#referrals">http://$c$c.google.com/mobile/analytics/docs/android/#referrals我曾在我的Android清单文件以下
I am attempting to get Android Referral tracking to work. I am following the only documentation I have found here http://code.google.com/mobile/analytics/docs/android/#referrals I have the following in my android manifest file
<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>
<receiver android:name="com.package.Receiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<uses-sdk android:minSdkVersion="4"/>
com.package.Receiver开头:
com.package.Receiver starts with:
public void onReceive(Context paramContext, Intent paramIntent) {
String str1 = paramIntent.getStringExtra("referrer");
Log.i("myapp", "action: '" + paramIntent.getAction() + "'
referrer string: '" + str1 + "'");
另外随着反编译com.google.android.apps.analytics.AnalyticsReceiver一点点有以下code。在它:
Also with a little bit of decompiling com.google.android.apps.analytics.AnalyticsReceiver has the following code in it:
public void onReceive(Context ctx, Intent intent)
/* */ {
/* 24 */ String referrer = intent.getStringExtra("referrer");
/* */
/* 26 */ if ((!
("com.android.vending.INSTALL_REFERRER".equals(intent.getAction())))
|| (referrer == null))
/* */ {
/* 28 */ return;
/* */ }
/* */
/* 31 */ String formattedReferrer = formatReferrer(referrer);
/* */
/* 33 */ if (formattedReferrer != null) {
/* 34 */ PersistentEventStore store = new
PersistentEventStore(ctx);
/* 35 */ store.setReferrer(formattedReferrer);
/* 36 */ Log.d("googleanalytics", new
StringBuilder().append("Stored
referrer:").append(formattedReferrer).toString());
/* */ } else {
/* 38 */ Log.w("googleanalytics", "Badly formatted referrer, ignored");
/* */ }
/* */ }
请注意两行36和38的日志googleanalytics我已经尝试推上面的应用市场,在我的Nexus One下载它(卸载该应用程序的previous版本之后)。我已经生成使用谷歌网页我挂在这篇文章的开头
Note the two lines 36 and 38 that Log "googleanalytics" I have tried pushing the above app to the market, downloading it on my Nexus One (after uninstalling a previous version of the app). I have generated a link using the google page I linked to at the beginning of this post
<$c$c>http://www.google.com/url?sa=D&q=http://market.android.com/search%3Fq%3Dpname:com.package.app%26referrer%3Dutm_source%253Dgoogle%2526utm_medium%253Dcpc%2526utm_term%253Drunning%25252Bshoes%2526utm_content%253Dcontent1%2526utm_campaign%253Dslogan&usg=AFQjCNFctwqk1WgWl0bhiIBNVqy3U4OPRw$c$c>
我重视的logcat我的Nexus One,而我从该链接下载的应用程序,我没有看到任何日志,从googleanalytics或MyApp的。谷歌分析库的其余部分也为我的应用程序。 I.E.我看到有关的网页点击率等谷歌分析记录,但是所有的流量来源是直接流量。我很茫然,什么是怎么回事。有谁 有什么见识到了什么我可能做错了什么?
I attached logcat to my Nexus One while I download the app from that link, I do not see any logs from "googleanalytics" or "myapp". The rest of the google analytics library does work for my app. I.E. I see records on google analytics about pages hits etc. However all the traffic sources are "Direct Traffic". I am at a loss as to what is going on. Does anyone have any insight into what I might be doing wrong?
推荐答案
由于通常我找到我自己的答案的情况。我的问题是在我的AndroidManifest.xml
As is often the case I found my own answer. My problem was in my AndroidManifest.xml
我有以下我的清单:
<manifest>
<application>
</application>
<receiver>
</receiver>
<uses-sd/>
</manifest>
接收器标签是在错误的位置。它应该是这样的。
The receiver tag was in the wrong spot. It should look like this
<manifest>
<application>
<receiver>
</receiver>
</application>
<uses-sd/>
</manifest>
我现在看见我希望,当我安装应用程序的日志。在几个小时希望谷歌Analytics(分析)将有数据为好。
I am now seeing the logs I expect to when I install the app. In a few hours hopefully Google Analytics will have the data as well.
这篇关于Android的转诊追踪不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!