Java – you cannot set a custom dimension in Google Analytics properties of Android apps

Please find the tracking code below,

GoogleAnalytics analytics = GoogleAnalytics. getInstance(this); Tracker t = analytics newTracker(MY_PROPERTY_ID); t.send(new HitBuilders.AppViewBuilder(). setCustomDimension(1,“testing custom dimension”). build());

The above code will be added to the click listener of the element in the UI

Index 1 in setcustomdimension refers to the dimension named "test" in my attribute settings, which is my only dimension for this attribute

Screen view sessions are tracked in the application overview but not added to the report for my custom dimension

I created a custom report using the custom tab

But I still haven't got any data from the custom dimension,

I checked the report after a day or even after many runs I'm using Android studio and didn't throw any errors / warnings in logcat

Please help me solve this problem If you can suggest any clean document / blog with sample code, it will be helpful to track advanced indicators of Android applications through Google Analytics

Thanks in advance:)

Solution

I have the same problem. It seems that there is a known problem in the SDK: https://code.google.com/p/analytics-issues/issues/detail?id=435.

Before sending a custom dimension to the tracker, you must set the screen name:

t.setScreenName("Home Screen");
t.send(new HitBuilders.AppViewBuilder().setCustomDimension(1,"testing custom dimension").build());
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>