Google Analytics中的自定义维度/指标
问题描述:
3天前我设置了以下代码。我想设置一个自定义变量以在Google Analytics
中使用。 3天后,我仍然没有在GA帐户中看到变量percentage
或score
(除非我不知道在哪里寻找,但我认为我已经查看了每个可用区域)。Google Analytics中的自定义维度/指标
我在GA中看到我的所有页面浏览量,而不是这些自定义变量。
这是或是否不是在GA中设置自定义变量的方式?
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.results);
EasyTracker.getInstance().activityStart(this);
final Tracker tracker = EasyTracker.getTracker();
cAnswers = getIntent().getIntExtra("correctAnswers", -1);
wAnswers = getIntent().getIntExtra("wrongAnswers", -1);
score = getIntent().getLongExtra("score", -1);
category = getIntent().getStringExtra("category");
qs = getIntent().getParcelableArrayListExtra("queries");
percentage = 10 * cAnswers;
tracker.setCustomMetric(1, (long)percentage);
tracker.setCustomMetric(2, score);
tracker.sendView();
答
您的代码与the documentation匹配,用于创建自定义指标。您是否已手动检查(long)percentage
和score
是否正在返回适当的类型?
编辑
如果您的代码运行良好(和它看起来像它应该是),自定义指标将可通过该API,自定义报表,以及先进的分段(docs here),但他们不会自动显示在任何默认报告中。
这听起来像你有兴趣通过网络界面看到指标,所以这里有一些关于creating custom reports的信息。
是的,有返回一个适当的类型。 google.com/analytics中有哪些内容需要我先做?或者它就像一个''''Pageview'''',它只是单独出现? – Matt 2013-03-07 15:28:54
明白了。我认为你的代码可能工作正常,但你不会看到自动显示的自定义指标和维度。我会更新我的答案,并提供更多关于如何查看它们的信息。 – Greg 2013-03-07 15:52:38
正是我在找的东西。谢谢。 – Matt 2013-03-07 17:09:26