• Resolved metapml

    (@metapml)


    Hey guys

    I need help. I am unable to understand how I capture the clicks of a button on AMP pages.

    I still have the pages in the html version. Only blog posts are in AMP.

    I’m using this script to try to capture clicks and send to Google Analytics, but it’s not working. (see the link in the AMP plugin)

    {
    "triggers": {
                "button": {
                  "selector": "#ctaamp-exa",
                  "on": "click",
                  "vars": {
                    "event_name": "cta-exa",
                    "method": "AMP"
                  }
                }
              }
    
    }

    https://nimb.ws/HxksCr

    I’m thinking of using Google tagmanager, but how should I create it?

    I have the HTML pages yet. And in Google tagmanager I must choose the WEB or AMP version.

    I thought it was better to pass the event directly to Google Analytics using the Script, but I couldn’t get it to work.

    Can anyone help me and check where I’m going wrong?`

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thanks for reaching out. Questions on event tracking would be better directed to the Analytics or Tag Manager Help Centers, where the product experts would be able to assist better than we can here. Looking at the snippet provided I’m unsure of your “Method” value.

    In relation to using Tag Manager you may find this a lot easier than manually adding your own event tracking triggers using the AMP plugins Analytics tab.

    You can also easily implement a Tag Manager AMP container on your site using the Site Kit plugin, which can also implement a regular web container for your non AMP URLs.

    Thread Starter metapml

    (@metapml)

    Hi James

    Thanks for the answer. I’m going to create a topic in the Google Tag Manager community.

    James Osborne

    (@jamesosborne)

    Great, thanks for the update and sorry we can’t be of more assistance.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Click for Google Analytics’ is closed to new replies.