Receive data from google analytics API

Hi
I’m about to create a simple analytics dashboard app, and I want my users to connect their google Analytics in order to get access to the data.

Is it possible to build an API connection like that in bubble?

Thanks

You might want to join forces with @Theodoros he is trying to do something similar.
This could be done in a few different ways - pros and cons to all of them.

The tricky part will be getting your head around permissions and educating your users on how to setup their GA accounts so that the data is accessible.

Thank you for the quick response, do you have links to the permissions and educating part you are talking about?

Thank you for the tag @lindsay_knowcode !

Hi @vyork , I am not sure that we are looking for the same thing.

This is what I would like to implement : link

1 Like

Yes! I was just working on this yesterday with a user!

Do you have any specific questions about processes?

2 Likes

Hi @vyork I’m the user @jared.gibb is talking about.

I’m actually dealing with the Google Search Console API rather than the Analytics API but the permissions process is the same (just different scopes).

I am somewhat familiar with the Analytics API though (it’s very similar to Google Search Console). And yes, Bubble is more than capable of doing what you are asking for.

The one complication I see is that Google are transitioning from Universal Analytics to GA4 which are two different APIs. The majority of users are probably still on the old one, some will be on new one and some will be on both, so the first thing you’re going to need to do is establish which one they are on (I assume you can do this via the API).

Anyway, if you need help I definitely recommend @jared.gibb (he has been helping me with some technical challenges to do with the Google API) as he knows this stuff far better than me and he has access to my app to copy my Oauth process for Google etc.

3 Likes

Hi, Jared.

Yeah I’m about to connect to the GA API and for now my config look like this:

I find it hard to find which parameters I should use and where to find them.
Thank you so much for helping me out. :slight_smile:

Amazing thanks, I will try to contact him. :slight_smile:

No problem.

In terms of which parameters to use. I’d take a look at this plugin so you can copy what they have done. Extended Google Analytics Plugin | Bubble if you click ‘see plugin code’ and then open up the API calls part you can see how they are doing it. e.g.

Or you could just use their plugin, given it’s free and save yourself some hassle.

1 Like

Thanks, It’s because I’m trying to learn how to set it up my self, in order to implement more API’s to my app my self. Do you know where I can find the end points in the google api doc?
Thank you so much for your help. :slight_smile:

Should all be documented here https://console.cloud.google.com/apis/library/analytics.googleapis.com

1 Like

Thanks, If I want to get access to the users individual page analytics, like homepage, and product page. Do you know which GET I should use? or is there a more overall GET I should use?

I think I’m close, now I get this error message.


1 Like

Given this:

Have you set up the social login part in your workflow? You need to do this to clear that message and initialize the API.



I have done this workflow, It was the same I used with the plugin Extended Google analytics, should that be different?

Also, you mentioned before that I could click see plugin code, can you show me where I do that?

Hi - should be the same. Did you manage to get everything fully working using the plugin? (if not, I would start there and get that working first, so that you know everything else is right and then you can replace it with your own API Connector setup)

To see the plugin code - go here Extended Google Analytics Plugin | Bubble click the button that says ‘See plugin code’ and then click ‘API calls’

Yes I did manage to connect with the Extended Google Analytics API, but I get an error when I’m trying do make it with the API Connector.

What does it show you when you hit that ‘learn more’ button?



This is what it says.
In the Extended Google API (egAPI) I could choose the API from the external API inside bubble but I can’t do that with the one I’m creating, is that because I haven’t done the workflow correct?

OK - to save us going round and round on this. I’ve set this all up in a test app in Bubble using the API Connector and everything works.
You can access it here Google-analytics-api | Bubble Editor

The page I put the social signup on is called ‘ga_auth’ so the authorised URI I have in console.cloud.google.com is https://google-analytics-api.bubbleapps.io/version-test/ga_auth?debug_mode=true

So now you can just copy what I have done.