react-gtm-components

0.5.0 • Public • Published

Installation

yarn add react-gtm-components

Usage

import { GtmScript, GtmNoScript } from 'react-gtm-components'

const gtmId = 'GTM-0000000'

<html>
	<head>
		<GtmScript gtmId={gtmId} />
		...
	</head>
	<body>
		<GtmNoScript gtmId={gtmId} />
		...
	</body>
</html>
import { GtmScript, GtmNoScript } from 'react-gtm-components'

const gtmId = 'GTM-0000000'
const gtmUrlParams = NODE_ENV === 'development' ? {
	gtm_auth: 'my_auth_key',
	gtm_preview: 'env-123',
} : {}

<html>
	<head>
		<GtmScript gtmId={gtmId} gtmUrlParams={gtmUrlParams} />
		...
	</head>
	<body>
		<GtmNoScript gtmId={gtmId} gtmUrlParams={gtmUrlParams} />
		...
	</body>
</html>

Examples/Tests

Check https://github.com/Yankovsky/react-gtm-components/blob/master/soon-to-be-test-folder/index.jsx

Readme

Keywords

none

Package Sidebar

Install

npm i react-gtm-components

Weekly Downloads

3

Version

0.5.0

License

MIT

Unpacked Size

162 kB

Total Files

16

Last publish

Collaborators

  • yankovsky