Google Analytics: Track Button Clicks

Background: The google analytics integration as I understand it only track “Page Screen Names” - and it does this by submitting the screen name to Page Title in GA4.

Need: I have buttons in the app that don’t open screens that I need to understand if they are being clicked on/ used.

ASK: Has anyone figured out how to do this? With a workaround?

(For Glideapps - I find that the focus is adding more and more features, rather than making the features as useful as possible - a full google analytics integration would enable us to understand user interactions properly and improve the apps for them - which is in your interest as well as ours).

1 Like

A workaround would be to include a multi-step action with those buttons that either increments a counter, or sets a timestamp.

1 Like

Hey Darren,

Thanks for the response. I see the functions you suggest, but I don’t understand how these would influence/ show up in google analytics.

To my knowledge glide does not send column changes or time stamps to GA4.

Perhaps I’ve missed some documentation or something on this?

They wouldn’t.
But you asked for a workaround for tracking button clicks :slight_smile:

I meant a workaround to get the data into GA4 :slight_smile:

We already track clicks in the app, but that’s messy and not married up with GA4 data which is more extensive.

@Darren_Murphy - With the introduction of the Code / JS column, would it be possible to have a compound action where I update column values for the parameters below( plan, click, Plan Name)?

ga(‘send’, {hitType: ‘event’, eventCategory: ‘plan’, eventAction: ‘click’, eventLabel: ‘Plan Name’ });

I tried to add this function to the JS column but ‘ga’ isn’t defined.

Would this be better done with Experimental Code?

I’m not sure I understand what you’re trying to do. What would you expect to happen if this worked?

The goal is to record a click event in Google Analytics, so that I can better track conversion and use of the application. Page names are good but don’t help if I have multiple interactions that link the user to the same page, or off the site to something like PayHere.

oh, right… so these would be your own custom metrics?

I’m not sure if this would be possible. I guess you’d need to find a way to import the analytics library, so that you can access the “ga” method (I assume that’s where it comes from).

Sorry, I’m not sure I’d even know where to start with this…

No problem. I’ll share back if I figure it out.

1 Like

Any luck?

Sorry, no. I love Glide but it wasn’t right for the project i took on. Ive paused for now.