0.0.1 • Published 9 years ago
@info.nl/react-google-tagmanager v0.0.1
react-google-tagmanager
Google Tag Manager code strings for React server page templates.
Installation
$ npm i @info.nl/react-google-tagmanager -S
Usage
import reactGoogleTagmanager from "react-google-tagmanager";
class Html extends Component {
render() {
const tagmanager = reactGoogleTagmanager(
process.env.GOOGLE_TAGMANAGER_ID,
'myLayer'
);
return (
<html>
...
<body>
<noscript
dangerouslySetInnerHTML={{__html: tagmanager.noscript}}
></noscript>
<script
dangerouslySetInnerHTML={{__html: tagmanager.script}}
></script>
...
</body>
</html>
)
}
}
License
MIT
0.0.1
9 years ago