I have implemented Google Analytics (GA) on my site and I send several custom events through ga("send", "event", ...);
function and it works well.
I am experimenting with Google Tag Manager (GTM). I have removed original GA snippet, and now I use GTM to inject GA tag on my site and pageviews are tracked correctly. What does not work well are my custom events sent by ga() function.
I have noticed that GA create
has tracker name variable like
ga("create", "UA-12345678-1", {name: "gtm0123456789", allowLinker: false});
and Google Analytics Debugger extension for Google Chrome reports Command ignored. Unknown target: undefined
.
I found out that send event call should include tracker name so it should look like ga("gtm0123456789.send", "event", ...);
, but I don't want to change all my existing GA send event
calls.
I quickfixed it by setting tracker name to empty string in GTM settings (Edit Tag -> More Settings -> Advanced Configuration -> ☑ Tracker Name
, leaving the textbox blank) and now it works, but I do not think it is such great solution.
Is there any other options to have my existing GA send event
calls and using also event tracking through GTM?