如何以编程方式设置ga_trackingId的财产? [英] How to programmatically set ga_trackingId property?

查看:304
本文介绍了如何以编程方式设置ga_trackingId的财产?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个单一的应用程序,但根据用户的选择,它会被监控完全在谷歌分析分开,所以我需要设置ga_trackingId用于编程的EasyTracker

I have a single app, but depending of user's choice, it will be monitored totally separated in google analytics, so I NEED to set "ga_trackingId" for EasyTracker programmatically.

我试过 EasyTracker.getTracker()。setAppId(ID)没有运气。

推荐答案

有关更改ID为的EasyTracker,这样做:

For changing the id for the EasyTracker, do this:

在onStart()

EasyTracker.getInstance(this).set(Fields.TRACKING_ID, "<your_ga_id");
EasyTracker.getInstance(this).activityStart(this);

的onStop()

EasyTracker.getInstance(this).activityStop(this);

这篇关于如何以编程方式设置ga_trackingId的财产?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆