Learn business growth with Google Analytics 4 Forums Google Analytics 4 Monitoring User Interaction on Custom Error Page

  • Monitoring User Interaction on Custom Error Page

    Posted by Olivia on 19 July 2022 at 3:21 pm

    I need to keep track of how many times those buttons are clicked. Just going by the links isn’t enough because they’re pretty frequent on our site. I’ve made sure each button has a unique label, which you can see in the code snippet below. I’ve set up a new event in my GTM tag where the action is {{click element}} and the label is {{click text}}. Ideally, I’d like to see every single button click on GA4. This is how I set up my GTM tag

    Below is my current 404.php file for my child theme.

    Snipped PHP Code

    The buttons on my current 404 page look like this (pulled directly from the flatsome UX builder, hence the syntax):

    Li replied 11 months ago 3 Members · 2 Replies
  • 2 Replies
  • Le

    13 October 2022 at 6:24 pm


    1. No need to provide links, your screenshot is just fine.

    2. As for tracking click events on your 404 page, you can totally do that. Try including a Custom JavaScript variable in your click trigger, that examines the page’s 404 text. There’s no need to get complicated with classes or anything on your CTAs – that would be overdoing it.

    3. I’d suggest tracking these types of navigations website wide, not just on your 404 page. Afterwards, you can sort out your data by page name or title in order to identify the 404 page clicks. It’s all about smart filtering, really!

  • Li

    30 May 2023 at 12:10 pm

    The individual is seeking to track every instance of a button click on their website using Google Tag Manager (GTM) and Google Analytics 4 (GA4). They have assigned each button a unique label and set up an event in their GTM where the action recorded will be the specific element clicked and the label the text that is clicked on. These specific measures are implemented because simply tracking the links isn’t sufficient due to their abundance on the site. They have shared how they have set up this tracking process and provided insight into their current code setup. Their goal is to have every single button click feature in their GA4 data analysis.

Log in to reply.