# Use Case: Allow user to Connect their Google Analytics and display data

**URL:** <https://community.weweb.io/t/use-case-allow-user-to-connect-their-google-analytics-and-display-data/3176>\
**Category:** How do I?\
**Created:** [June 22, 2023, 3:21pm UTC](https://community.weweb.io/t/use-case-allow-user-to-connect-their-google-analytics-and-display-data/3176 "2023-06-22T15:21:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikm3103](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@erikm3103](https://community.weweb.io/u/erikm3103)\
**Post date:** [June 22, 2023, 3:21pm UTC](https://community.weweb.io/t/use-case-allow-user-to-connect-their-google-analytics-and-display-data/3176/1 "2023-06-22T15:21:38Z")

</div>

Hi everyone,

I’m new here and I love a good challenge - so I’m building an application and I’m on good way, however, I have a hinder which I’m struggling with. I have noticed that there is not too much YouTube videos, documentation and such which is what I’ve always used when I’m stuck, so I’m trying the community forum for the first time.

I have a page in the web application that looks like this. The idea is that when the user clicks a button called “Connect Integration”.

They will end up on a page like this (I have already setup everything in Google and it works well, so no help needed here).

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/d/db50b539fc3cb5396f6b566c175d23cea0612c45.png)

They will then be redirected back to the application and see the data in the graphs etc.

You have probably all seen or done this before, as it’s common to do in applications. So I’m hoping I can get some detailed help on how to recreate this - I think it will add value to the community as this is non-existent anywhere!

I’m struggling to understand if this is something I can or should use any of the Google Int API from Xano (which is my backend) or if I should do more actions in the frontend.

Happy to get all the input and learning I can, thank you! PS: If I get a really good answer, I’ll share what I’m creating - with ZERO coding experience!

---

<div class="post-metadata">

**Author:** ![erikm3103](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@erikm3103](https://community.weweb.io/u/erikm3103)\
**Post date:** [June 22, 2023, 7:03pm UTC](https://community.weweb.io/t/use-case-allow-user-to-connect-their-google-analytics-and-display-data/3176/2 "2023-06-22T19:03:38Z")

</div>

🙂 appreciate any help I can get!🙂

---

<div class="post-metadata">

**Author:** ![jaredgibb](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@jaredgibb](https://community.weweb.io/u/jaredgibb)\
**Post date:** [June 22, 2023, 8:52pm UTC](https://community.weweb.io/t/use-case-allow-user-to-connect-their-google-analytics-and-display-data/3176/3 "2023-06-22T20:52:08Z")

</div>

once the user is sent back to the app, you need to exchange the code paramter `https://example.com/redirect_page?code=lij23l4ji2lk4j2&state=some%20string`’s from the url for an access token. Once the token is available, you can call the endpoints from [GA](https://developers.google.com/analytics/devguides/reporting/core/v4/user-reporting) and throw the access token in the Authorization header.

---

<div class="post-metadata">

**Author:** ![erikm3103](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@erikm3103](https://community.weweb.io/u/erikm3103)\
**Post date:** [June 24, 2023, 7:50am UTC](https://community.weweb.io/t/use-case-allow-user-to-connect-their-google-analytics-and-display-data/3176/4 "2023-06-24T07:50:07Z")

</div>

Hi jared,

Thanks for taking the time to explain. This seems like it might be missing a part, as I assume the refresh/access token should be stored somewhere? How is this done?

From what I read the user would need to connect every time they log in. How would I in that case get the access token dynamically in the Auth Header, I assume the access token changes every x.

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [June 26, 2023, 7:46pm UTC](https://community.weweb.io/t/use-case-allow-user-to-connect-their-google-analytics-and-display-data/3176/5 "2023-06-26T19:46:25Z")

</div>

Hi @erikm3103 👋

Here’s a video that explains how to [setup Google login with Xano and WeWeb](https://www.youtube.com/live/FaTHPG9kUrk?feature=share&t=768). I don’t think it covers your exact use case but you might find it helpful regardless as it covers a few OAuth basics.

When we did the live stream, I personally found the section where Q explains how Google & WeWeb communicate super helpful (at 28:30) because it’s applicable to any provider and any frontend but I’d recommend taking the time to watch everything from 12:48 onwards to get the full context.

Let me know if it helps!

---

<div class="post-metadata">

**Author:** ![bravo](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bravo](https://community.weweb.io/u/bravo)\
**Post date:** [November 5, 2023, 4:18am UTC](https://community.weweb.io/t/use-case-allow-user-to-connect-their-google-analytics-and-display-data/3176/6 "2023-11-05T04:18:56Z")

</div>

Hi @erikm3103, I would also like to integrate YouTube/Google Analytics, so I am wondering if you were able to find a solution to this? Would love to chat and see if there is any way we can collaborate 🙂

---

<div class="post-metadata">

**Author:** ![erikm3103](https://avatars.discourse-cdn.com/v4/letter/e/c37758/32.png) [@erikm3103](https://community.weweb.io/u/erikm3103)\
**Post date:** [November 11, 2023, 8:01am UTC](https://community.weweb.io/t/use-case-allow-user-to-connect-their-google-analytics-and-display-data/3176/7 "2023-11-11T08:01:48Z")

</div>

Hi Bravo,

I never actuallly implemented this as it was not needed anymore. However, now that I’ve used WeWeb for some time, I belive the process is very similar to how you would setup a reset password flow in terms of the token in a query etc.

I think it might be some good videos on YouTube where people do the whole process with Bubble, might be helpful:)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [November 11, 2023, 10:58am UTC](https://community.weweb.io/t/use-case-allow-user-to-connect-their-google-analytics-and-display-data/3176/8 "2023-11-11T10:58:05Z")

</div>

Anything with an REST API can be implemented.
