Skip to content

Instantly share code, notes, and snippets.

@asamountain
Created January 6, 2020 10:35
Show Gist options
  • Save asamountain/d61256d816c96116e8d278737e5ceeba to your computer and use it in GitHub Desktop.
Save asamountain/d61256d816c96116e8d278737e5ceeba to your computer and use it in GitHub Desktop.
App.js for react-gtm-module
import React from 'react';
import ReactDOM from 'react-dom';
import {Router} from 'react-router-dom';
import './index.css';
import App from './App';
import {createBrowserHistory} from 'history';
import TagManager from 'react-gtm-module'
const history = createBrowserHistory();
const tagManagerArgs = {
gtmId: 'GTM-000000'
}
TagManager.initialize(tagManagerArgs);
const Root = document.getElementById('root')
ReactDOM.hydrate(
<Router history={history}>
<App/>
</Router>, Root);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment