3
votes

I'm trying to get the custom dimensions feature of Google Analytics for Android (V2) working on my Android app.

I have everything else working but I can't get it reporting the custom dimension.

I have the custom dimension "age" defined on the web client.

Right now my onStart() looks like:

  public void onStart() {
    super.onStart();
    EasyTracker.getInstance().activityStart(this);
    String dimensionValue = "20-29";
    Tracker tracker = EasyTracker.getTracker();
    tracker.setCustomDimension(1, dimensionValue);
    tracker.trackView();
  }

Any help would be appreciated.

Thanks!

1

1 Answers

0
votes

Can you check out the lastest SDK release here and make sure it was not a bug in the previous version?

Also, the format of the track calls has changed from track* to send* to be consistent across APIs so you'll need to use the following format.

Tracker tracker = EasyTracker.getTracker();
tracker.setCustomDimension(1, "myValue");    
tracker.sendView();