0
votes

Inside Google analytics admin section I created 4 custom dimension. 1st dimension scope is "user", 2nd, 3rd and 4th dimension's scope is "hit".

I set parameters inside my onCreate function and send them in onStart command of my Activity. But when I check custom reports, I see that 1st dimension is set correctly. But no data for other 3 dimensions. I tried different days and waited but no change. I can see 1st dimension's data successfully. How can I set these custom dimensions, what do I miss ?

   @Override
    public void onCreate(Bundle savedInstanceState) {
        MyUtil.initializeGAtracker(mContext);
        MyUtil.getGaTracker().set(Fields.customDimension(1), "aaa");
        MyUtil.getGaTracker().set(Fields.customDimension(2), "bbb");
        MyUtil.getGaTracker().set(Fields.customDimension(3), "ccc");
        MyUtil.getGaTracker().set(Fields.customDimension(4), "ddd");
        MyUtil.getGaTracker().set(Fields.SCREEN_NAME, "myscreen");
    }

    @Override
    public void onStart() {
        super.onStart();
        MyUtil.getGaTracker().send(MapBuilder.createAppView().build());

    }

I also tried this. But it didn't help:

MyUtil.getGaTracker().send(MapBuilder
             .createAppView()
              .set(Fields.customDimension(2), "bbb")
              .set(Fields.customDimension(3), "ccc")
              .set(Fields.customDimension(4), "ddd")
                    .build()
                    );

Is there a detailed resource for setting multiple custom dimensions ?

I only found this: https://developers.google.com/analytics/devguides/collection/android/v3/customdimsmets

Edit: Documentation is not adequate, also custom dimensions documentation has syntax error.

1

1 Answers

1
votes

The code that you provided should work correctly.

  • Can you provide more details on MyUtil class?
  • Do you see any errors in debug mode? The SDK should output a bunch of errors if there is something wrong.
  • The SDK also prints out the hits that it is sending over wire. Can you copy and paste one of such hits here?
  • Also, your code snippets do not show you setting the tracking id. Can you check that you have set the ID? You can set it in the xml config or in the SDK APIs.