Answer the question
In order to leave comments, you need to log in
How to properly set up a target in google and kick it from gtag.js?
The problem is the following - you need to set up a goal in Google and pull it when you call the popup on the site. I set up a goal in Google Analytics:
1 goal setting: custom template
2 goal description: name callback_form_click event type
3 goal details: category equals callback_form, action equals click.
In turn, the gtag script is connected on the site in this way:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-156076612-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-156076612-1');//UA-129104230-1
</script>
gtag('event', 'callback_form_click', {
// параметры событий
'event_category': 'callback_form',
'event_action': 'click',
// ...
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question