Skip to content

Commit

Permalink
chore: migrato UA to GA4, cleanup lib
Browse files Browse the repository at this point in the history
  • Loading branch information
ppapman1 committed Feb 19, 2023
1 parent 1ed14c6 commit abcfba3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install dependencies
run: yarn
- name: Build
run: VITE_API_BASE_URL=https://adofai.gg:9200 VITE_UA_NUMBER='UA-181311513-1' yarn build
run: VITE_API_BASE_URL=https://adofai.gg:9200 VITE_UA_NUMBER='UA-181311513-1' VITE_GA_NUMBER='G-3BKXMVNJYQ' yarn build
- name: Zip output
run: cd dist && zip -r ../dist.zip . && cd ..
- name: Upload artifact
Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@
"framer-motion": "^6.2.8",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-ga": "^3.3.0",
"react-ga4": "^2.0.0",
"react-infinite-scroll-component": "^6.1.0",
"react-loading-skeleton": "^2.2.0",
"react-markdown": "^6.0.3",
"react-meta-tags": "^1.0.1",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.0",
"react-select": "^5.2.2",
"react-simple-infinite-loading": "^1.1.0",
"react-toastify": "^8.1.1",
"react-tooltip": "^4.2.21",
"react-transition-group": "^4.4.2",
"react-virtualized": "^9.22.3",
"react-virtuoso": "^2.8.0",
"styled-components": "^5.3.3",
"sweetalert2": "^11.0.18",
Expand Down
9 changes: 4 additions & 5 deletions src/routes/LevelPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ const LevelPage = ({ history }) => {
title: 'Photosensitive Content Included',
html: (
<>
This level includes flashing imagery and this might
trigger photosensitive epilepsy.
This level includes flashing imagery and this might trigger
photosensitive epilepsy.
<br />
<br />
To prevent this, play this level in a well-lit room, and don't play
Expand All @@ -92,8 +92,7 @@ const LevelPage = ({ history }) => {
title: 'NSFW Content Included',
html: (
<>
This level includes{' '}
<strong>NSFW (sexual or gore) content</strong>.
This level includes <strong>NSFW (sexual or gore) content</strong>.
<br />
<br />
If you don't want to see NSFW content included in this level,
Expand Down Expand Up @@ -441,7 +440,7 @@ const LevelPage = ({ history }) => {
src={`https://www.youtube.com/embed/${state.level.youtubeId}`}
title='YouTube video player'
frameBorder='0'
// allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen"
allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen;'
/>
</div>
</div>
Expand Down
5 changes: 2 additions & 3 deletions src/usePageTracking.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { useEffect, useState } from 'react';
import { useLocation } from 'react-router-dom';
import ReactGA from 'react-ga';
import ReactGA from 'react-ga4';

const usePageTracking = () => {
const location = useLocation();
const [initialized, setInitialized] = useState(false);

useEffect(() => {
ReactGA.initialize(`${import.meta.env.VITE_UA_NUMBER}`);
ReactGA.initialize(`${import.meta.env.VITE_GA_NUMBER}`);
setInitialized(true);
}, []);

useEffect(() => {
if (initialized) {
ReactGA.set({ page: location.pathname });
ReactGA.pageview(location.pathname);
}
}, [initialized, location]);
};
Expand Down

0 comments on commit abcfba3

Please sign in to comment.