matomo-org / tag-manager

Free Open Source Matomo Tag Manager - A simple way to manage and maintain all of your (third-party) tags on your website.
https://matomo.org
GNU General Public License v3.0
174 stars 58 forks source link

Tracking not working with Tag Manager | Works with direct _paq.push #169

Closed tpimpao closed 5 years ago

tpimpao commented 5 years ago

Hi there, I'm trying the Tag Manager, i create a basic Tag and Trigger in my container. The Tag basically set an Event with a EventCategory="FAQS" and EventAction="{{ClickID}}" and a EventName="{{ClickText}}". The Trigger is "All Element Click". Nothing special here...

Testing in the page with the Debug i see in the Log tab:

"event: "
{"tags":[{"action":"Fire","type":"Matomo","name":"Matomo Analytics","numExecuted":1}],"variables":[],"metTrigger":{"name":"Clique em todos os elementos","type":"AllElementsClick"},"name":"mtm.AllElementsClick","eventData":{"event":"mtm.AllElementsClick","mtm.clickElement":{"piwikTrackers":[{}]},"mtm.clickElementId":"tema2","mtm.clickElementClasses":"active","mtm.clickText":"Questões Gerais","mtm.clickNodeName":"A","mtm.clickElementUrl":"https://mysite.com/Pages/faqs.aspx?mtmPreviewMode=L5WMFUOW#"},"container":{"variables":[{"name":"ClickClasses","type":"ClickClasses","value":"active"},{"name":"Configuração do Matomo","type":"MatomoConfiguration","value":{"matomoUrl":"https://dv-matomo.com/","idSite":"5","enableLinkTracking":true,"enableCrossDomainLinking":false,"enableDoNotTrack":false,"enableJSErrorTracking":false,"enableHeartBeatTimer":false,"trackAllContentImpressions":false,"trackVisibleContentImpressions":false,"disableCookies":false,"setSecureCookie":false,"cookieDomain":"","cookiePath":"","alwaysUseSendBeacon":false,"userId":"","customDimensions":[],"bundleTracker":true}}],"tags":[{"action":"Not Fired Yet","type":"Matomo","name":"Matomo Analytics","numExecuted":1}],"id":"L5WMFUOW","versionName":"Versão Teste 1","dataLayer":{"mtm.containerId":"L5WMFUOW","mtm.startTime":1563792547126,"event":"mtm.AllElementsClick","mtm.mtmScriptLoadedTime":1563792547363,"mtm.clickElement":{"piwikTrackers":[{}]},"mtm.clickElementId":"tema2","mtm.clickElementClasses":"active","mtm.clickText":"Questões Gerais","mtm.clickNodeName":"A","mtm.clickElementUrl":"https://mysite.com/Pages/faqs.aspx?mtmPreviewMode=L5WMFUOW#"}},"time":"11:49:10 AM.762","index0":0,"index":1}

So, the Tag and Trigger are correctly fired, but watching in the Matomo Dashboard (Visits in Real-time) i not see the fired event, only the Page load Action.

For testing proposes i set a event in the page button, and i can see the event in the Matomo Dashboard (Visits in Real-time). onclick="_paq.push(['trackEvent', 'click', 'btnDownload']);"

Also looked for Nginx, Database and Matomo logs, but nothing special there.

Any idea for debugging my issue? Thanks, TP

tsteur commented 5 years ago

Can you maybe send us a link to the page where we can have a quick look? It's otherwise hard to tell. In any case, make sure the eventAction actually has a value... otherwise Matomo won't track the event. Feel free to email us link to hello at matomo.org

tpimpao commented 5 years ago

Hi tsteur, Sorry, but im working in an internal website, its not available to the www. I miss an important information, this issue happen in a new matomo environment. In our production environment everthing work, so for testing, I point the website to our production environment and the tag manager fire the event. It must be anything related with configuration or an issue in the new matomo instance. There are any way to see server side what is happen? Some debug log?

Thanks for your time and help. TP

tsteur commented 5 years ago

@tpimpao this sounds more like something for our forum as it seems to be working in general: https://forum.matomo.org

I would recommend you ask there.

In general make sure there is no ad blocker active, maybe compare the configuration of the container and your app if there are any differences. Eg you could export the container under "Versions" on both local and production and compare if there's any difference. Also make sure the local Matomo is correctly configured.

Without being able to reproduce it I can't look into it unfortunately. Happy to look into it if you have a page where this is reproducible. Eg maybe you can save your web page as "save complete page as html" and upload it onto a public server and maybe it is reproducible there.