Mobile app version of vmapp.org
Login or Join
Kaufman445

: Tracking universal analytics events through Google Tag Manager I have an Universal Analytics property installed on my site through Google Tag Manager. Following this article on tracking classic

@Kaufman445

Posted in: #GoogleAnalytics #TagManager

I have an Universal Analytics property installed on my site through Google Tag Manager.

Following this article on tracking classic ga.js events through GTM I have given my tracker a global name _gua. Now I try to fire events using additional HTML tag as described in the article:

<script type="text/javascript">
$(function () {
$('.some-class').click(function () {
gua('send', 'event', 'button', 'click');
});
});
</script>


The script is working fine but each time I call the _gua to send the event I get the following message from the GA Debugger:

Command ignored. Unknown target: undefined


Is it even possible to use GTM and GUA this way? I don't want to use the data layer and GTM events...

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kaufman445

1 Comments

Sorted by latest first Latest Oldest Best

 

@Turnbaugh106

As far as I've figured it out:

With GTM you have to create tags within the tool to handle and match with updates on the dataLayer object via dataLayer.push("event", ...) on your page, which then again "redirects" your events over the tags to Analytics.
developers.google.com/tag-manager/devguide#datalayer
For the ga() function, you need to set up a tracker first and use the direct Analytics tracking code (not GTM) for proper event tracking. See following links:
groups.google.com/d/msg/google-analytics-analyticsjs/mayu2cf1d0k/UBkWsZEQvjYJ developers.google.com/analytics/devguides/collection/analyticsjs/advanced
Personally I took the second, direct approach.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme