Answer the question
In order to leave comments, you need to log in
Why might gtag() google analytics events not fire?
Hey!
Again I ran into the debiloid logic of Google.
I set a goal, when you click in the console.log, the command passes.
It doesn't show up in google analytics.
What could be the problem?
Created a goal with the same name, category and event
var whatsAppBtn = document.querySelector('.link');
if (whatsAppBtn) {
whatsAppBtn.addEventListener('click', function () {
gtag('event', 'Клик по ссылке WhatsApp', {
'event_category': 'Click',
'event_action': 'whatsapp'
});
console.log('WhatsApp');
});
}
window.onload = function () {
gtag('event', 'loaded');
console.log('loaded page')
}
Answer the question
In order to leave comments, you need to log in
Try this code (do not change anything in the Google Analytics goal settings):
gtag('event', 'whatsapp', {
'event_category' : 'Click'
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question