Skip to content

Commit

Permalink
Remove deprecated ga
Browse files Browse the repository at this point in the history
  • Loading branch information
zk-phi committed Oct 5, 2023
1 parent 6556265 commit 6b31414
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
7 changes: 0 additions & 7 deletions src/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ let mode = "";
const switchMode = (value: string, interactive?: boolean) => {
mode = value;
if (GA4_TOKEN && interactive) {
ga("send", "pageview", `/${value}`);
gtag("event", "switch_mode", { mode: value });
} else {
// eslint-disable-next-line no-console
Expand All @@ -14,15 +13,12 @@ const switchMode = (value: string, interactive?: boolean) => {
};

const changeFont = (value: string) => {

Check warning on line 15 in src/utils/analytics.ts

View workflow job for this annotation

GitHub Actions / lint-js

'value' is defined but never used

Check failure on line 15 in src/utils/analytics.ts

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected empty arrow function
ga("set", "dimension1", value);
};

const changeAnimation = (animationName: string, effectNames: string[]) => {

Check warning on line 18 in src/utils/analytics.ts

View workflow job for this annotation

GitHub Actions / lint-js

'animationName' is defined but never used

Check warning on line 18 in src/utils/analytics.ts

View workflow job for this annotation

GitHub Actions / lint-js

'effectNames' is defined but never used

Check failure on line 18 in src/utils/analytics.ts

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected empty arrow function
ga("set", "dimension2", `${animationName}/${effectNames.join(",")}`);
};

const render = () => {
ga("send", "event", mode, "render");
if (GA4_TOKEN) {
gtag("event", "render_emoji", { mode });
} else {
Expand All @@ -32,7 +28,6 @@ const render = () => {
};

const download = () => {
ga("send", "event", mode, "download");
if (GA4_TOKEN) {
gtag("event", "download", { mode });
} else {
Expand All @@ -43,8 +38,6 @@ const download = () => {

export default (() => {
if (GA4_TOKEN) {
ga("create", "UA-121793995-1", "auto");
ga("send", "pageview", "/");
gtag("js", new Date());
gtag("config", GA4_TOKEN);
// eslint-disable-next-line no-console
Expand Down
6 changes: 0 additions & 6 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
<meta property="og:image" content="https://zk-phi.github.io/MEGAMOJI/ogp.webp">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@zk_phi">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
</script>
<script async src="https://www.googletagmanager.com/gtag/js"></script>
<script>
window.dataLayer = window.dataLayer || [];
Expand Down

0 comments on commit 6b31414

Please sign in to comment.