Answer the question
In order to leave comments, you need to log in
How to fix error in gtag event?
In the header of the site I connect
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-*******"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-*******');
</script>
<script type="text/javascript">
$(document).ready(function(){
gtag('event', button10, {
event_category: 'successful_payment4',
event_action: 'button10'
});
});
</script>
Uncaught ReferenceError: button10 is not defined
at HTMLDocument.<anonymous> (test.php?clear_cache=Y:501)
at e (jQuery-3.4.1.min.js?161458549188145:2)
at t (jQuery-3.4.1.min.js?161458549188145:2)
Answer the question
In order to leave comments, you need to log in
There is an error in the event code. "button10" must be enclosed in quotes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question