2

I am using gtm with Universal analytics tag in my website. I know gtm fires - "gtm.js", "gtm.click", "gtm.dom", "gtm.load" etc events and send event data to google analytics based on rules specified in the triggers. I want to listen to all these gtm events. And whenever any of these gtm events fires, I want to fetch the eventdata that it sends to google analytics, from my javascript attached in the webpage.

Can anyone tell me how can I trigger a my custom event in javascript whenever any of the gtm events trigger and fetch that event data it sends to google analytics? Simply, What code should I write in js to listen gtm.click like event and fetch the data that it sends to google analytics?

1
  • What are you hoping to do with this data? Temporary setup testing/troubleshooting, or something more? If it's just "look at it sometimes" the GTM Preview mode might do everything you need.
    – Reve
    Commented Sep 17, 2018 at 13:15

2 Answers 2

1

These things you mention are listeners. I’m wondering the same as Reve, what do you try to accomplish? Most triggers for pageviews or events depend on these triggers. Here is a list how they do:

  • gtm.js is equal to the “pageview” trigger. Meaning GTM script is loaded and ready
  • gtm.dom is when the DOM is loaded
  • gtm.load is when the window is loaded
  • gtm.click is to track clicks on the HTML markup
  • gtm.linkClick is to track clicks on a-elements

So these do not actually send anything, they are the triggers that make sure you can send something.

0

I would suggest Logstalgia and gource. These softwares are free and are web server access log visualization tools. With these tools you will be able to see real-time and pre-recorded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.