Google Tag Manager GA4 Button Tracking

Hello,

Has anyone successfully implemented button click tracking with Google Tag Manager and Google Analytics 4?

Hoping to find javascript code that I can run to trigger this if nothing else.

Thank you,
Tyler

I’ve a plugin that exactly solves this, you need to do this all the time in a Bubble Single Page App.

If you don’t want to use my plugin that’s ok :slight_smile: and really want javascript then the things to search for are “page view events” or “custom events” in the Google API.

Will this also work to report link clicks? I have a link to another page on the website, but I want to track the actual link click vs. the new page load.

There is a method in my plugin to solve that exact problem. Something like Send events and open a new window

As you’ve probably figured out when you navigate away from a page via a link that normally won’t be captured in GA4 because the browser will kill the JS before the event is logged to GA

Thank you for that. I got the idea from this tutorial, he seems to be able to track when a link is clicked. He’s able to use the variables from the link click as a trigger, start the video around 1 hr 20 min… https://www.youtube.com/watch?v=1dwk_erXAko&t=316s

1 Like

Hi @lindsay_knowcode
Does your plugin work for apps that are not single-page apps?
I’m having trouble sending custom events to GA4.
Thanks!

It does work just in normal pages apps. If you purchase my plugin, that would make me very happy and we can get on a screen share call, and do a health check of your wider GA4 setup;

  • check the setup of the measurement id(s) in the GA console
  • check it on the Bubble side
  • discuss and add dimensions to your reports if that makes sense for your case
  • add GA4 exception measurement into your setup (if that makes sense for your case)

I’m in GMT+12 Auckland New Zealand - PM me if we need to find a convenient time to get online.

My guess is that it isn’t a problem with the GA4 plugins (mine or others) but you might have some other setup problem. As a guess.

Thank you so much @lindsay_knowcode. I followed your advice and apparently I had the measurement id all wrong. Now it works. I will keep playing with this for a while and will be in touch if I decide to purchase your plugin. Thanks for your kind offer, that’s good support!

1 Like

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