'react-gtm-module appears to create an invalid src path?
It appears that react-gtm-module
is creating the wrong src path. It is swapping a "/" with a ".".
This is the src
path as provided by Google.
https://www.googletagmanager.com/gtag/js?
Whereas the src path below is generated by react-gtm-module
gtag: https://www.googletagmanager.com/gtm.js?
Google tag manager flags this error. script async="" src=""https://www.googletagmanager.com/gtm.js?id=AW-xxx871634>m_auth=>m_preview=>m_cookies_win=x"">/script
Invalid or missing account ID?
HTTP response code indicates tag failed to fire: Status 404. This could be due to an empty or un-published container.
I think I am initializing react-gtm-module correctly:
import GTagManager from 'react-gtm-module';
GTagManager.initialize({gtmId: 'AW-xxx871634'});
class App extends React.Component {
Any help would be appreciated.
Solution 1:[1]
Resolved.
Google Tag Manager (GTM) has two approaches for supplying tracking conversion information. One approach is to send the conversion ID to GTM. The other approach is to send the container ID GTM.
react-gtm-module works by supplying the container ID versus the conversion ID. My error was initializing with the conversion ID. Using the container ID works as expected.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Bruce |