Add Custom Metric to GA Using Google Tag Manager

Comments:6

  1. Why not just add the metric to the pageview trigger itself rather than creating an event & a custom metric just to record the custom metric? Btw, How is it that your Event tag does not have a Value field?

    1. Good questions, thank you for your comment! Sure, in this example case you could add the custom metric to a Page View tag instead of an Event tag. The custom metric would be implemented in exactly the same way and have the same result. I chose to show an Event tag example though because 1) in my experience that’s a much more common use case, and 2) it keeps the Page View tag clean. In this example, if you sent the custom metric with a Page View tag instead, now you’d need to either write some new trigger logic using JavaScript, or duplicate the original Page View tag and then add blog-specific triggers and exceptions to both versions, to ensure that the custom metric only gets sent on the tags on the blog pages.

      I wouldn’t populate the Value field since there’s no measurable monetary value to someone viewing my blog. I guess I could make an estimate for it but I prefer to keep Values for something more concrete.

  2. In Your example, you have UA firing on a specific page.. how does this work if I already have Google UA firing on all pages.

    1. The example setup doesn’t change your existing implementation at all, it just adds on an event tag. It’s completely standard that UA fires on all pages, so don’t change that, just add an event tag with a trigger for the page or event you’re interested in.

Leave a Reply

Your email address will not be published.