Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Google Tag Manager - log when a button pressed

Options
  • 09-09-2016 12:00pm
    #1
    Registered Users Posts: 6,493 ✭✭✭


    I am trying to configure Google Tag Manager to record the page url when a button on the page is pressed. The button opens a jQuery dialog.

    I've looked at GTM docs and tutorials but they are unclear to me and feel like they don't match the latest GTM interface.


    I have a Universal Analytics tag with my tracking ID and Track Type "Page View"
    The trigger is "Click - All Elements" for "Some Clicks" and "Click Classes" contains "single_add_to_cart_button"
    See attached screenshot.

    The container has been published.

    I then go to my website and browse around the page views are being recorded but not the events.

    When I go to Google Analytics "Real-Time" and "Events" nothing is being registered. I am seeing active users and the pages that they are on.

    What am doing wrong?


Comments

  • Registered Users Posts: 1,254 ✭✭✭blue4ever


    They can be very sneaky!

    I how that it may sound a little overkill but its handy to find out what exactly is firing on the click. So, as a temporary measure set up a new tag (called clicks) and have the trigger as all clicks – I know, overkill, but stick with me.
    Save that’s and Preview and debug

    Go to the page where the button is and (in debug mode) “Ctrl Click” – it means that the click will open a new tab and your debug screen will stay on the first page and update.
    You should see something like the attached below

    You can then see exactly whats being reported and that might help you see is there is something else hitting the datalayer that might catch it.

    An alternative would be to edit your CMS and give the button a unique ID
    <link href="mysite.com/shop" id="add_to_cart_button" /> and track that.

    Hope that might get you further down the line.


  • Registered Users Posts: 6,493 ✭✭✭daymobrew


    I joined a closed Facebook group for GTM questions and was directed to the measureschool channel on YouTube.

    In the Google Tag Manager Button Click Tracking video it suggested exactly what you suggested - an all clicks trigger and then find out the classes you need to filter on (via Preview/Debug mode). This was a great help.

    Next is to figure out how to record a form submission...


Advertisement