Show users how many page views and unique views they've had on their profile

Hi all,

I’d like to show my users who are logged in how many:
a) total page views
b) total unique views

Both within a specific period. How would I pull that data?

You could record all page view data in your database (add a new datatype and create a new thing on every page load - with some way of distinguishing new and repeat views), then simply access the data in an element for your users with a filter to set the time period.

But it’s probably easier just to use Google Analytics (or any other tracking service) then pull the data into your app via API (or they may be a plugin for it).

Is there a free way to pull the data from GA via an API?

Sure, just use the Bubble API connector to connect to GA.

I meant to pull the data back into Bubble to surface to the end user, can that be done with that too?

Yes. I’m not that familiar with GA’s API personally, but having just had a quick look over their API docs, you can get pretty much any data you want from your GA account via their API.

Once you’ve set up the API connector, and your calls, then you can access any of that data in your app pages, and display it anyway you like.

Although it will take some time to familiarize yourself with their API, so you may find it easier to use the free ‘Extended Google Analytics’ plugin by Zeroqode (I haven’t used it myself, so I’m not sure what/how much data you can access, but it might be worth a look).

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.