Since few days ago, google analytics brings some challenges for me and I’d like to share with you.
The result about a request made to GA4 brings a Json splitted into some parts (dimensionsHeader, metricsHeader, rowsHeader, row count, metadata and kind) at once result.
All I need it as a single table, where dimensions + metrics will be the header, the rows will be the content, but I don’t figure it out to transform it in just few nodes or have to rename columns to identify each one. (hard work)…
Do you know a simple way with json nodes to be correctly set to solve it? I try many many ways and didn’t match it.
If I were you I would just use one JSON Path node and one Ungroup node. Query the columns by its specific location within the JSON and name it accordingly. Example:
defaultChannelGroup = $['rows'][*]['dimensionValues'][0]['value']
firstUserSourceMedium = $['rows'][*]['dimensionValues'][1]['value']
etc.
It’s a one time job that took me two minutes maximum, unless the file that you retrieve changes frequently in format.
Thanks for you advices, But I haven’t a way that the knime pick up the first and second block to name de columns, and the rows just to complete the values?
As I told before, I’ve some reportes and I’d like that a trick way can put the header and the content at once without make one-by-one.
If I haven’t other way, OK, I can do it as you told me. From my example, I could bring the dimensionsHeader and metricHeader separated and after that, combine it together; but how can I merge the header from a path with the content from other where they will stay at the same positions (from the origin) and create a table? Do I make me clear? An automation process to extract and create the table with the existing values.
This will automatically pick-up the content of dimensionHeaders and metricHeaders and insert them as columns headers on the top flow that handles the extractions of all values.