fix(#268): remove matomo from project

pull/54/head
Andrei Dekterev 3 years ago
parent 34dfd327bb
commit 6ed5fea40d
  1. 2
      .gitignore
  2. 38766
      package-lock.json
  3. 1
      package.json
  4. 8
      public/index.html
  5. 25
      src/config/matomo.tsx
  6. 1
      src/config/pages.tsx
  7. 5
      src/features/App/index.tsx
  8. 9
      src/features/GlobalStores/index.tsx

2
.gitignore vendored

@ -7,6 +7,8 @@
# testing # testing
/coverage /coverage
/cypress/videos
/cypress/screenshots
# production # production
/build /build

38766
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -21,7 +21,6 @@
"insports": "REACT_APP_CLIENT=insports react-scripts start" "insports": "REACT_APP_CLIENT=insports react-scripts start"
}, },
"dependencies": { "dependencies": {
"@jonkoops/matomo-tracker-react": "^0.7.0",
"@stripe/react-stripe-js": "^1.4.0", "@stripe/react-stripe-js": "^1.4.0",
"@stripe/stripe-js": "^1.13.2", "@stripe/stripe-js": "^1.13.2",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",

@ -42,14 +42,6 @@
name="msapplication-config" name="msapplication-config"
content="%PUBLIC_URL%/clients/%REACT_APP_CLIENT%/favicon/browserconfig.xml" /> content="%PUBLIC_URL%/clients/%REACT_APP_CLIENT%/favicon/browserconfig.xml" />
<% } %> <% } %>
<!-- Matomo Tag Manager -->
<script>
var _mtm = window._mtm = window._mtm || [];
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='https://matomo.insports.tv/js/container_KFCeSAkC.js'; s.parentNode.insertBefore(g,s);
</script>
<!-- End Matomo Tag Manager -->
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>

@ -1,25 +0,0 @@
import { createInstance } from '@jonkoops/matomo-tracker-react'
import { InstanceParams } from '@jonkoops/matomo-tracker-react/lib/types'
import { PAGES } from 'config/pages'
const getMatomoInstance = () => {
let matomoInstance: InstanceParams = {
siteId: 999,
urlBase: 'link.to.domain',
}
switch (process.env.REACT_APP_CLIENT) {
case 'insports':
matomoInstance = {
...matomoInstance,
siteId: 1,
urlBase: PAGES.matomoInstatBaseUrl,
}
break
}
return createInstance(matomoInstance)
}
export const matomoInstance = getMatomoInstance()

@ -4,7 +4,6 @@ export const PAGES = {
home: '/', home: '/',
mailings: '/useraccount/mailings', mailings: '/useraccount/mailings',
match: '/matches', match: '/matches',
matomoInstatBaseUrl: 'https://matomo.insports.tv/',
player: '/players', player: '/players',
team: '/teams', team: '/teams',
thanksForSubscribe: '/thanks-for-subscription', thanksForSubscribe: '/thanks-for-subscription',

@ -5,11 +5,8 @@ import {
} from 'react' } from 'react'
import { Router } from 'react-router-dom' import { Router } from 'react-router-dom'
import { MatomoProvider } from '@jonkoops/matomo-tracker-react'
import { history } from 'config/history' import { history } from 'config/history'
import { client } from 'config/clients' import { client } from 'config/clients'
import { matomoInstance } from 'config/matomo'
import { isAvailable } from 'config/env' import { isAvailable } from 'config/env'
import { readToken } from 'helpers' import { readToken } from 'helpers'
@ -45,7 +42,6 @@ const startDate = '2022-11-24T23:00:00'
const stopDate = '2022-11-25T05:00:00' const stopDate = '2022-11-25T05:00:00'
const OTTApp = () => ( const OTTApp = () => (
<MatomoProvider value={matomoInstance}>
<Router history={history}> <Router history={history}>
<Theme> <Theme>
<GlobalStyles /> <GlobalStyles />
@ -61,7 +57,6 @@ const OTTApp = () => (
</GlobalStores> </GlobalStores>
</Theme> </Theme>
</Router> </Router>
</MatomoProvider>
) )
export default OTTApp export default OTTApp

@ -6,8 +6,6 @@ import {
import { useLocation } from 'react-router' import { useLocation } from 'react-router'
import { useMatomo } from '@jonkoops/matomo-tracker-react'
import { getLanguageUrlParam } from 'helpers/languageUrlParam' import { getLanguageUrlParam } from 'helpers/languageUrlParam'
import { AuthStore } from 'features/AuthStore' import { AuthStore } from 'features/AuthStore'
@ -25,15 +23,8 @@ type Props = {
export const GlobalStores = ({ children }: Props) => { export const GlobalStores = ({ children }: Props) => {
const { pathname, search } = useLocation() const { pathname, search } = useLocation()
const { trackPageView } = useMatomo()
const [isGeoReady, setIsGeoReady] = useState(false) const [isGeoReady, setIsGeoReady] = useState(false)
useEffect(() => {
const isProduction = process.env.REACT_APP_ENV === 'production'
if (isProduction) trackPageView()
}, [trackPageView, pathname, search])
useEffect(() => { useEffect(() => {
(async () => { (async () => {
if (pathname === '/' && search === '') { if (pathname === '/' && search === '') {

Loading…
Cancel
Save