Skip to content

Commit

Permalink
chore: drop Google Analytics 3
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Aug 23, 2024
1 parent 62b18b9 commit c822295
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 80 deletions.
7 changes: 0 additions & 7 deletions src/config/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import * as React from "react";
import ReactDOM from "react-dom";
import "../utils/gaInit";
import Root from "./components/Root";
import store from "./store";

ga("create", "UA-81509238-9", {
cookieFlags: "max-age=7200;secure;samesite=none",
});
ga("set", "anonymizeIp", true);
ga("send", "pageview", "/config.html");

const rootElement = document.getElementById("root");
ReactDOM.render(<Root store={store} />, rootElement);
21 changes: 0 additions & 21 deletions src/utils/ga.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/utils/gaInit.js

This file was deleted.

11 changes: 0 additions & 11 deletions src/viewer/Entity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,6 @@ class Entity extends React.Component<Props & CardsProps, State> {
if (prevState.isHovering && !this.state.isHovering) {
this.setState({ isMeaningfulHover: false });
}
if (
this.state.isHovering &&
!prevState.isMeaningfulHover &&
this.state.isMeaningfulHover
) {
if (this.props.dbfId) {
ga("send", "event", "Overlay", "Hover Card", String(this.props.dbfId));
} else {
ga("send", "event", "Overlay", "Hover Card");
}
}
}

public componentWillUnmount(): void {
Expand Down
18 changes: 3 additions & 15 deletions src/viewer/mobile/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,11 @@ import {
BoardStatePlayer,
EBSConfiguration,
} from "../../twitch-hdt";
import {
Feature,
hasFeature,
OverlayPosition,
WhenToShowBobsBuddy,
} from "../../utils/config";
import { Feature, hasFeature, WhenToShowBobsBuddy } from "../../utils/config";
import { PortalProvider } from "../../utils/portal";
import { TwitchExtProps, withTwitchExt } from "../../utils/twitch";
import CopyDeckButton, {
CopyDeckButtonChild,
CopyDeckButtonChildProps,
} from "../CopyDeckButton";
import { CopyDeckIcon, HSReplayNetIcon } from "../icons";
import CopyDeckButton, { CopyDeckButtonChildProps } from "../CopyDeckButton";
import { HSReplayNetIcon } from "../icons";
import BobsBuddy from "../overlay/BobsBuddy";
import { TooltipBehaviour, TooltipProvider } from "../utils/tooltips";
import CardList from "./CardList";
Expand Down Expand Up @@ -357,10 +349,6 @@ class Panel extends React.Component<Props & TwitchExtProps, State> {
this.setState({ timedOut: true });
}, 30 * 1000);
}

private onCopy = () => {
ga("send", "event", "Deck", "Copy", "Mobile");
};
}

export default withTwitchExt(Panel);
7 changes: 0 additions & 7 deletions src/viewer/mobile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,13 @@ import {
CardsProvider,
getHearthstoneLocaleFromTwitchLocale,
} from "../../utils/cards";
import "../../utils/gaInit";
import {
TwitchExtConsumer,
TwitchExtConsumerArgs,
TwitchExtProvider,
} from "../../utils/twitch";
import Root from "./Root";

ga("create", "UA-81509238-9", {
cookieFlags: "max-age=7200;secure;samesite=none",
});
ga("set", "anonymizeIp", true);
ga("send", "pageview", "/mobile.html");

const rootElement = document.getElementById("root");
ReactDOM.render(
<TwitchExtProvider>
Expand Down
8 changes: 1 addition & 7 deletions src/viewer/overlay/DeckList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class DeckList extends React.Component<
position={this.props.position}
>
<li>
<CopyDeckButton deck={this.props.deck} onCopy={DeckList.onCopy}>
<CopyDeckButton deck={this.props.deck}>
{({
disabled,
copied,
Expand Down Expand Up @@ -312,7 +312,6 @@ class DeckList extends React.Component<
) {
e.currentTarget.blur();
}
ga("send", "event", "Deck", "Hide");
}}
onMouseDown={this.stopPropagation}
title="Automatically hide deck list"
Expand All @@ -331,7 +330,6 @@ class DeckList extends React.Component<
if (target && typeof target.blur === "function") {
target.blur();
}
ga("send", "event", "Deck", "Show");
}}
onMouseDown={this.stopPropagation}
title="Keep deck list visible"
Expand Down Expand Up @@ -392,10 +390,6 @@ class DeckList extends React.Component<
return;
}
}

private static onCopy() {
ga("send", "event", "Deck", "Copy", "Overlay");
}
}

export default withTwitchExt(withCards(DeckList));
7 changes: 0 additions & 7 deletions src/viewer/overlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,13 @@ import {
CardsProvider,
getHearthstoneLocaleFromTwitchLocale,
} from "../../utils/cards";
import "../../utils/gaInit";
import {
TwitchExtConsumer,
TwitchExtConsumerArgs,
TwitchExtProvider,
} from "../../utils/twitch";
import Root from "./Root";

ga("create", "UA-81509238-9", {
cookieFlags: "max-age=7200;secure;samesite=none",
});
ga("set", "anonymizeIp", true);
ga("send", "pageview", "/overlay.html");

const rootElement = document.getElementById("root");
ReactDOM.render(
<TwitchExtProvider>
Expand Down

0 comments on commit c822295

Please sign in to comment.