Open hurifajri opened 3 years ago
We can use setTimeout
, but I am not sure is it good idea 🤔
setTimeout(() => {
TagManager.initialize({ gtmId: process.env.NEXT_PUBLIC_GTM_ID });
}, 4000);
You can instead install react-gtm-module-defer
and then in your code import TagManager from 'react-gtm-module-defer'
. That will change async
to defer
.
Does this module automatically set the script to use
async
attribute? How can I change todefer
?