-
Troubleshooting issue with Google Analytics 4's set method
Hey there, I’ve got a bit of a head-scratcher here. I’m working on setting up Google Analytics 4, not using Google Tag Manager just to be clear. According to the Google docs, these two bits of code should do the same thing:
First off, we’ve got this:
`javascript
gtag(‘event’, ‘testing’, {‘foo’:’x’});
`
And then there’s this:`javascript
gtag(‘set’, {‘foo’:’x’});
gtag(‘event’, ‘testing’);
`
Now here’s the kicker: the first one is working just as I’d hoped, but the second one? Not so much. It’s like the ‘set’ bit just goes in one ear and out the other; the property ‘foo’ is ignored. What gives? Any ideas what could be causing this peculiar behavior?
Log in to reply.