Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: add google tag manager (#2028)

authored by

Brigi Csap and committed by
GitHub
5e24ffdd 83f51553

+24 -1
+1
packages/site/package.json
··· 43 43 "react": "^17.0.2", 44 44 "react-dom": "^17.0.2", 45 45 "react-ga": "^3.3.0", 46 + "react-gtm-module": "^2.0.11", 46 47 "react-inlinesvg": "^1.2.0", 47 48 "react-is": "^17.0.2", 48 49 "react-router": "^5.2.0",
+6 -1
packages/site/src/app.js
··· 1 1 // eslint-disable-next-line react/no-multi-comp 2 2 3 - import React from 'react'; 3 + import React, { useEffect } from 'react'; 4 4 import { Root, Routes } from 'react-static'; 5 5 import { ThemeProvider } from 'styled-components'; 6 6 ··· 8 8 import { GlobalStyle } from './styles/global'; 9 9 import * as theme from './styles/theme'; 10 10 import Analytics from './google-analytics'; 11 + import { initGoogleTagManager } from './google-tag-manager'; 11 12 import { Loading } from './components/loading'; 12 13 13 14 const App = () => { 15 + useEffect(() => { 16 + initGoogleTagManager(); 17 + }, []); 18 + 14 19 return ( 15 20 <Root> 16 21 <ThemeProvider theme={theme}>
+12
packages/site/src/google-tag-manager.js
··· 1 + /** 2 + * Google Tag Manager 3 + */ 4 + const TagManager = require('react-gtm-module'); 5 + 6 + export const initGoogleTagManager = () => { 7 + if (typeof document === 'undefined') { 8 + return {}; 9 + } else { 10 + return TagManager.initialize({ gtmId: 'GTM-MD32945' }); 11 + } 12 + };
+5
yarn.lock
··· 13210 13210 resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-3.3.0.tgz#c91f407198adcb3b49e2bc5c12b3fe460039b3ca" 13211 13211 integrity sha512-o8RScHj6Lb8cwy3GMrVH6NJvL+y0zpJvKtc0+wmH7Bt23rszJmnqEQxRbyrqUzk9DTJIHoP42bfO5rswC9SWBQ== 13212 13212 13213 + react-gtm-module@^2.0.11: 13214 + version "2.0.11" 13215 + resolved "https://registry.yarnpkg.com/react-gtm-module/-/react-gtm-module-2.0.11.tgz#14484dac8257acd93614e347c32da9c5ac524206" 13216 + integrity sha512-8gyj4TTxeP7eEyc2QKawEuQoAZdjKvMY4pgWfycGmqGByhs17fR+zEBs0JUDq4US/l+vbTl+6zvUIx27iDo/Vw== 13217 + 13213 13218 react-helmet-async@^1.0.7: 13214 13219 version "1.0.9" 13215 13220 resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-1.0.9.tgz#5b9ed2059de6b4aab47f769532f9fbcbce16c5ca"