jquery - Firing Google Analytics event for each item in JS array using GTM -


I am trying to track the visit of specific topics on my website. Each article can be tagged with many topics, so the only way to track visits to each subject seems to be to firing an event for each topic in the article.

I'm using Google Analytics (UA) and Google Tag Manager.

So far I have created the following as a custom HTML tag in GTM:

   

It provides a string on the webpage, which changes the subject of the JavaScript array, then it removes any duplicates, and in the array of each item is a Removes the event. Or at least, this is the last bit to do.

If I change the ga ('send' ... code with a warning () tag, then I suspect that it is not known

Am I doing wrong? Is there a better way to do this, and GTM's macro, tags etc?

Thanks


Comments