-
Troubleshooting Browser Back Function with gtag.js in GA4
Hey folks, stuck here! Need some help improving the event triggers in GA4 with DTM for one of my clients. I have added Script1 in the head section and Script2 right at the top of the body section of our website, and from what I can tell, the event is firing correctly because the clicks and views are being counted on Google Analytics realtime page and DebugView.
But here’s a hitch: every time I click on a link and then hit the browser back button, instead of landing me back on the previous page, it takes me to the page before that. This keeps happening whenever I use the back function. Strange, isn’t it?
I’ve noticed this problem across different platforms:
- MacOS Google Chrome’s incognito mode and Safari
- iOS’s versions of Google Chrome and Safari
- Google Chrome on Android
And interestingly, this only occurs if you don’t have a JS plugin installed on your browser. No idea why! If anyone knows how to tweak this around, would really appreciate the help.
You can find scripts1 and scripts2 below, if that helps. Thank you in advance!
[Here instert scripts]
Log in to reply.