When I try the “Preview” button on the Google Tag Manager admin site, if I try localhost:3000 with my development server running, I get a connection pretty quickly and confirmation that I’ve set it up correctly. However, if I try to run any of the domains that are associated with this deployment on Vercel (https://microbeninja.com, https://annihilyzer.microbeninja.com, https://depot.microbeninja.com, or https://store.microbeninja.com), I get a timeout error. I’ve tried with and without my adblocker on and with and without Firefox’s tracker protection on. With the localhost:3000 connection, it was working fine with tracking and adblocking enabled anyway. I can also see that the gtm.js is included and looks exactly the same on local development as it does on the live site.
I ended up using Google Analytics and @frontity/google-analytics, which immediately worked, but I believe this is the second time I’ve tried to use Google Tag Manager for analytics with Frontity and it didn’t work. I believe this is still an issue because the Google Analytics only works with Universal Analytics and not the new Google Analytics 4, which will probably be forced on all of us sooner than later.
I’ve just tested it in our own web, frontity.org, which is using GTM and Vercel as well, and it works fine in the live environment. I’ve tried with both Google Chrome and Firefox, so I’m not sure what could be the issue. In the past, I have also encountered issues with GTM preview and sometimes they were solved accessing in Incognito mode if you want to try.
By the way, the pageviews and events are enabled by default for both @frontity/google-tag-manager and @frontity/google-analytics, so you don’t have to specify that in your frontity.settings.js as you are doing here.
Regarding this, you are totally right. Thanks a lot for pointing it out . I’ve created an issue to solve it. I tested it quickly and it shouldn’t be difficult to adapt.