Analytics受众特征对于Android应用

Analytics受众特征对于Android应用

本文介绍了Google Analytics受众特征对于Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google Play服务库在Android应用上使用了Google Analytics受众特征。
我使用enableAdvertisingIdCollection()更新了我的android代码。
其屏幕和数据正常工作。但其人口统计信息无效?
请建议我如何处理人口统计资料。

感谢您。

编码:
应用程序代码:

...

  synchronized Tracker getTracker( TrackerName trackerId,String appKey)
{

Log.d(Application,In Application class getTracker PID+ appKey);
if(!mTrackers.containsKey(trackerId))
{

GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);

analytics.setDryRun(false);

analytics.getLogger()。setLogLevel(Logger.LogLevel.INFO);

Tracker t =(trackerId == TrackerName.APP_TRACKER)? analytics.newTracker(appKey):analytics
.newTracker(R.xml.app_tracker);

if(t!= null)
{
t.enableAdvertisingIdCollection(true);
}

mTrackers.put(trackerId,t);

}
返回mTrackers.get(trackerId);

...



oncreate()的代码



...

  try 
{

GoogleAnalytics.getInstance(getActivity())。reportActivityStart(getActivity());

Tracker t =((AppApplication)getActivity()。getApplication())。getTracker(TrackerName.APP_TRACKER,Appkey);
t.setScreenName(Home Screen);
// t.setSampleRate(sampleRate);
t.enableAdvertisingIdCollection(true);
t.send(new HitBuilders.AppViewBuilder()。build());


$ b catch(Exception ex)
{
CustomLogger.showLog(GAcode,ex.getMessage());
}


解决方案

,以及大多数的stackoverflow和Facebook的链接,我没有找到任何帮助或代码调整,可以启用Android移动应用的人口统计数据为最近的谷歌SDK。
但我仍然通过发送活动通过跟踪器与人员的详细信息发现了自定义的人口统计数据。
$ b p因此,我得出结论认为,Google Analytics受众特征与网络应用完美协作,但它不支持android应用程序。

I used Google Analytics Demographics on android app using Google play service library.i have updated my android code using enableAdvertisingIdCollection().its working fine with screens and data. But its demographics info isn't working?Please suggest how do i handle demographics.

thanking you.

Code :Application code :

...

 synchronized Tracker getTracker( TrackerName trackerId, String appKey)
 {

    Log.d("Application", "In Application class getTracker PID" + appKey);
    if (!mTrackers.containsKey(trackerId))
    {

        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);

        analytics.setDryRun(false);

        analytics.getLogger().setLogLevel(Logger.LogLevel.INFO);

        Tracker t = (trackerId == TrackerName.APP_TRACKER) ? analytics.newTracker(appKey) : analytics
                .newTracker(R.xml.app_tracker);

        if (t != null)
        {
            t.enableAdvertisingIdCollection(true);
        }

        mTrackers.put(trackerId, t);

    }
    return mTrackers.get(trackerId);
}

...

code on oncreate()

...

 try
 {

    GoogleAnalytics.getInstance(getActivity()).reportActivityStart(getActivity());

        Tracker t = ((AppApplication) getActivity().getApplication()).getTracker(TrackerName.APP_TRACKER, Appkey);
        t.setScreenName("Home Screen");
        // t.setSampleRate(sampleRate);
        t.enableAdvertisingIdCollection(true);
        t.send(new HitBuilders.AppViewBuilder().build());


    }
    catch (Exception ex)
    {
        CustomLogger.showLog("GAcode", ex.getMessage());
    }
解决方案

I looked at google documentation thoroughly, and as well as most of the stackoverflow and Facebook links, I didn't found any help or code tweak that could enable demographics in android mobile apps for recent google sdk.But still i found custom demographics by sending events through tracker with details about people.

So ,I concluded that Google Analytics Demographics works perfectly with web apps but yet it did not support android apps.

这篇关于Google Analytics受众特征对于Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 04:30