Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Google Tag Manager Tag Assist / Debug mode and Preview not working #23

@robpataki

Description

@robpataki

Hi @PauloMFJ and @JPedersen , great work on this plugin!

I've found an issue. Unfortunately I don't have time to raise a PR, but I wanted to raise this anyway in case someone else has time to look into fixing this issue.

When next-gtm is implemented in a NextJS (12.1.6) project, I could confirm using Omnibug and Real time data in Google Analytics that GTM was set up, and GA was capturing page view events alright.

However, in Google Tag Manager the Preview / Live Debug feature does not seem to work with this plugin. It seems that the way the plugin loads up the gtag js file with the auth and debug params causes the script to fail to load due to a 403 HTTP error, and even though the Tag Assist and the debugged live site are connected, there is no traffic being captured when running the site in debug mode.

Once I implemented GTM using the NextJS way (https://github.com/vercel/next.js/tree/canary/examples/with-google-tag-manager) everything started to work - including the Debug / Preview feature.

Please see the screenshot for reference:

bug-gtm-01
bug-gtm-02

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions