Open damiangreen opened 6 years ago
I managed to get it working by doing the following:
const x= gtm.scriptAsHTML().replace(/[\n\r]/g, '').replace(/<\/?script>/g, '')
and then in my helmet tag:
<script type='text/javascript'>
{x}
</script>
It would be great if the api supported the above as it's a little hacky. Are pull request welcome?
Does this mean that by using Helmet that GTM can be loaded/unloaded at will?
Is it possible to use this with react-helmet? https://github.com/nfl/react-helmet