• Command ignored. Unknown target: undefined.

    by  • Last modified:October 3, 2015 • Google Analytics • 0 Comments

    Recently I was playing with Google Tag Manager. I also had some existing custom events and other javascript which I placed into a HTML Tag. While using Google Analytics debugging tool, though, I got the following console error:

    Command ignored. Unknown target: undefined.

    Thankfully I found this post.

    The issue seems to be that the GA create tracker name adds a variable. To avoid redoing all the custom events, the quick fix is to give the tracker a blank name. You can do this by going to GTM settings (Edit Tag -> More Settings -> Advanced Configuration -> ☑ Tracker Name). Just leave the textbox blank for the name. Now it works!

    This solution by Mert is a super work-around too:

    var trackerName = ga.getAll()[0].get('name');
    ga(trackerName + '.send', 'event', { eventCategory: 'category1', eventAction: 'action1', eventValue: 0 });

    About

    About The Author: Adrian has over 12 years experience in Digital Marketing and Analytics. He currently works as a Marketing Manager at Vanilla Forums, a modern forum software platform that allows clients to connect and engage their communities and customers. Adrian has extensive experience with Google and Piwik Analytics. He lives and works in Montreal.