-
Accessing Event Data with Custom Properties in GA4
“Hey all,
I’ve got a little problem. I’m using GA4 to keep track of all the applications our customers have installed. We need to know which versions they’re running. Our app is a web app (WAR) on Tomcat.
For each webpage that’s generated and sent to the client browser, we’ve added this gtag script:
gtag('config', 'OUR-COMON-GA4-ID', {'app_version': '1.0.1'});
. We include extra config info (https://developers.google.com/tag-platform/gtagjs/reference#config), which GA4 attaches to each logged event.But here’s where things get tricky. How do you read this extra info using the official JAVA library for GA4? We need to figure out the app versions that are generating each event.
Also, when I attempted to add a new dimension
addDimensions(Dimension.newBuilder().setName("event_params.app_version"))
, I ended up with an error: INVALID_ARGUMENT: Field event_params.app_version is not a valid dimension. The thing is, without this dimension, I can read the data successfully! I’ve got some code here if it helps you figure out what’s going on:[CODE BLOCK]
Can anyone out there help me understand how to read this data?
Thanks a million!”
Log in to reply.