fix (StrictMode): Fix issue where google script will be injected twice in StrictMode due to InitGTM being fired twice and the script operation just appending to the dom
Update scripts to React 18
InitGTM will now delete existing script and readd if found to avoid duplicate scripts.
Demo updated to use StrictMode
In theory InitGTM could just be a noop if the script already exists, but I am unsure if there is scope for a script to be reregistered for some reason, hence the delete/add approach.
fix (StrictMode): Fix issue where google script will be injected twice in
StrictMode
due to InitGTM being fired twice and the script operation just appending to the domIn theory InitGTM could just be a noop if the script already exists, but I am unsure if there is scope for a script to be reregistered for some reason, hence the delete/add approach.