I want to set a user scope dimension in Google Analytics using the SDK v4. The value of this dimension never changes in runtime.
When I created the dimension following this instructions the page gave me this code:
String dimensionValue = "SOME_DIMENSION_VALUE";
tracker.set(Fields.customDimension(1), dimensionValue);
This code is for SDK v3 and doesn't work at SDK4.
I readed this too: Custom Dimensions & Metrics - Android SDK v4. Their solution is to set the dimension EVERY time I send a page view, event, etc. That is mess! This dimension never changes. The sesion or user dimensions change less than the screen name which can be saved at tracker level.
Here my question: Is there a method to set the custom dimensions at tracker level like the Tracker.setScreenName
?
There are 20 custom dimension slots in a Google Analytics Standard account, and 200 slots in a GA 360 account.
In GA4, you can set up 50 event-scoped custom dimensions and 25 user-scoped custom dimensions per property.
See: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cd_
So I think it should be:
String dimensionValue = "SOME_DIMENSION_VALUE";
tracker.set("&cd1", dimensionValue); //custom dimension 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With