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
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.

Google Tag Manager - log when a button pressed

  • 09-09-2016 12:00PM
    #1
    Registered Users, Registered Users 2 Posts: 6,636
    ✭✭✭


    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, Registered Users 2 Posts: 1,258 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, Registered Users 2 Posts: 6,636 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...


Welcome!

It looks like you're new here. Sign in or register to get started.
Advertisement