0

I was able to get analytics and demographics data until I have updated to GAv4, I am able to receive analytics data now but not the demographics data. My code is :

In Application class

    Tracker mTracker;
    synchronized public Tracker getDefaultTracker()
{
    if (mTracker == null)
    {
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        mTracker = analytics.newTracker(R.xml.app_tracker);
        mTracker.enableAdvertisingIdCollection(true);
    }
    return mTracker;
}

app_tracker.xml

<?xml version="1.0" encoding="utf-8"?>

<resources>
<integer name="ga_sessionTimeout">300</integer>
<bool name="ga_autoActivityTracking">true</bool>    
<string name="ga_trackingId">UA-XXXXXXXX-X</string>
<string name="ga_sampleFrequency">100.0</string>
<bool name="ga_reportUncaughtExceptions">true</bool>

</resources> 

Code in my HomeActivity class:

Tracker mTracker;
onCreate(--)
{
  ----
mTracker = application.getDefaultTracker();
    //  enable demograpics data gathering
    mTracker.enableAdvertisingIdCollection(true);
 -----
}

onResume(--)
{
  ---
mTracker.setScreenName(TAG);
    mTracker.send(new HitBuilders.ScreenViewBuilder().build());
---
}

On Analytics console for demographics tab I see a message "Some data in this report may have been removed when a threshold was applied. Learn more". I have not included Policy requirements as I didn't find any templates for it. Could that be the problem? Any suggestions are highly appreciated.

Murli
  • 524
  • 6
  • 11

0 Answers0