Use Google MetaData API


So i have been workign on a component to resolve 3 pain points with the Google Analytics Query node; Reliability (re-try on error), Pagination(when returned rows exceeds 10K, Accuracy(any date range creates a request per day to ensure no sampling from the GA end)

So far all of these have been resolved and work a charm. I have wrapped them in a component and i have used them in some client work generating all the reports i need hassle free.

The core challenge for me now is to make this a shareable component.
It’s not currently shareable, because in order to set the google query, you need to disconnect the component after import in your workflow, then CTRL+click to edit the component, giving you access to the GA query node.

I’m trying to build the component interface to build the query. The challenge is around setting the dimension and metric selections.

One way was to generate a fixes list and users can select from that. Tedious to say the least and not ideal.

The other is to use the Google Analytics MetaData API, which i’m pretty sure is what the query node is also using.

The issue is i am not entirely sure how to go about this.
Any pointers would be most appreciated.

My current thinking: Use the GET request node. This seems like the fastest way to do this, however, i need the Google API key.
I’m working with p12 file, so i need to extract the key from here.
Again, no idea how i might go about this.

ok, so this one is now resolved too, and as it turns out it was (embarrassingly) simple.

After reading through the dev docs i stumbled on the reference section to find that a simple GET request was possible without the need for authorisation.

This didn’t quite give me everything i wanted as i was hoping to auth and return the actual metadata for the given user and profile, the differnce is that the ui names for custom dimensions/metrics are user/account specific, however this for now is a starter for 10 and i can work on the rest in due time.

But, it does provide the standard dimension and metric listings.

I will continue to work on a p12 node that will allow this to be more specific to the connection selected but i have a hunch i’m going to have to go into knime dev mode which at the moment is beyond my current skill set…


Glad you got it figured out. And thanks for uploading your finalized component to the Hub - I haven’t had a chance to play around with it yet, but it seems like it’s going to be very useful! :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.