-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Description
Hi I got reported with this error https://support.google.com/tagmanager/answer/14779480#zippy=%2Cshow-me-an-example from Tag diagnostics
the issue is it said the config is called after the send event, but we did initialize in index.tsx and only call the first event in app.tsx, so there is no way the initialization happens before the first event was called
...
const RootApp = () => {
useEffect(() => {
TagManager.initialize({
gtmId: process.env.REACT_APP_GOOGLE_TAGMANAGER_ID || "",
});
}, []);
return (
<AppWrapper />
)->
export const sendAnalyticsEvent = (
eventName,
eventData,
) => {
eventData.event = eventName;
TagManager.dataLayer({
dataLayer: eventData,
});
};
const App = () => {
useEffect(() => {
sendAnalyticsEvent("page_view", { some_details_here });
}, []);
....
}
so how come GTM complains that the config was happening after the first event was sent? or is the initialize missing something? Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels