react-google-tag-manager
react-google-tag-manager copied to clipboard
Is it possible to use this with react-helmet?
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?