I've created a Stackblitz demo of my setup.
This is the index.html
GA Script:
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-140430388-3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){
dataLayer.push(arguments)
}
gtag('js', new Date());
</script>
And this is the code being executed to trigger events:
uaClick1() {
console.log("CLICKED UA 1")
gtag('event', 'MY_BUTTON_!_CLICK', {
'event_category': 'BUTTON_CLICK',
'event_label': 'UA Click 1',
'value': 'Some custom value 1' })
}
uaClick2() {
console.log("CLICKED UA 2")
gtag('event', 'MY_BUTTON_2_CLICK', {
'event_category': 'BUTTON_CLICK',
'event_label': 'UA Click 1',
'value': 'Some custom value 2' })
}
When I click the buttons I don't see the events popping up anywhere (Not sure exactly where I should be looking ...) in the GA console.
Thoughts?