I created a custom dimension and metric and am trying to fill it with data from an Android app. I created a new dashboard of a table using the custom dimension (user id which is declared at the user scope) and the custom metric (bad attempts which is at the hit scope level), but the dashboard says that there are no values to show. Maybe I'm sending the data in a wrong way?
This is how I do it:
public static enum CustomDimensions
{
USER_ID(1);
private int value;
CustomDimensions(int numVal)
{
this.value = numVal;
}
public int getValue()
{
return value;
}
};
public static enum CustomMetrices
{
BAD_ATTEMPTS(1);
private int value;
CustomMetrices(int numVal)
{
this.value = numVal;
}
public int getValue()
{
return value;
}
};
public static void SendCustomEvent(Activity act, CustomDimensions cd, String dimensionValue,
CustomMetrices cm, int metricValue)
{
Tracker tracker = getGoogleAnalyticsTracker(act);
tracker.send(new HitBuilders.EventBuilder().setCustomDimension(cd.getValue(), dimensionValue).build());
tracker.send(new HitBuilders.EventBuilder().setCategory("customCategory").setAction("customAction")
.setLabel("customLabel").setCustomMetric(cm.getValue(), metricValue).build());
}
and the call itself:
SendCustomEvent(this, CustomDimensions.USER_ID,
"1", CustomMetrices.BAD_ATTEMPTS, 1);
In the behavior section of the report I do see the events with customCategory and so on, but not any value of the dimension or metric.