1
votes

I am trying to send the custom data in google analytics version 4 where the sending procedure seems to be different then previous version, I have create a custom dimention from google analytics web page then with the corresponding index I am sending the repective value as mention below,

Tracker tracker = ((Application) getApplication())
                .getTracker(TrackerName.APP_TRACKER);
tracker.send(new HitBuilders.AppViewBuilder()
        .setCustomDimension(1,  "info1")
        .build());
        tracker.send(new HitBuilders.AppViewBuilder()
        .setCustomDimension(2, "info2")
        .build());

from the logs it seems that the data is send but not sure as I am unable to view any data in the google analytics web page.

2

2 Answers

1
votes

You'll have to create a custom report and select the custom dimension, and any metrics associated with that custom dimension. For some reason Google hasn't (and who knows if they will) update the Custom Variables report.

1
votes

You can define a custom report (Google Analytics > Customization (top tab)), but you need to make sure you select the right Metric or your information will not appear (e.g. ga:hits). https://support.google.com/analytics/answer/1151300?hl=en

Alternatively you can query the information through Google Analytics Query Explorer, although not choosing the correct dimension / metric will result in no data to appear (e.g. ga:dimension1 + ga:hits). http://ga-dev-tools.appspot.com/explorer/

Obviously might take a few good seconds / couple of minutes for information to be available, and important for fresh information make sure the date range includes today (yes, it happens to best of us to refresh furiously and find out Google Analytics date range was up to yesterday :-)

Developer reference (for anyone else looking for it): https://developers.google.com/analytics/devguides/collection/android/v4/customdimsmets