Skip to content

Commit

Permalink
Remove google analytics (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-bowden authored Oct 6, 2024
1 parent 683a89f commit ccde1b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/main/java/co/uk/bittwisted/CapsLockHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public class CapsLockHook extends JFrame implements NativeKeyListener {
private final String appDataFolderPath = System.getenv("APPDATA") + "\\cap-lock-hook";

private final GradientPaint defaultBackgroundGradient;
private final AnalyticService analyticService;

public CapsLockHook() throws AWTException {
setTitle("CapUp");
Expand All @@ -67,7 +66,6 @@ public CapsLockHook() throws AWTException {

robot = new Robot();
appConfig = new AppConfig(appDataFolderPath);
analyticService = new AnalyticService(appConfig.getClientId());
defaultBackgroundGradient = new GradientPaint(100, 0, Color.BLACK, getWidth()+50, getHeight(), Color.GRAY);

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
Expand Down Expand Up @@ -221,7 +219,6 @@ private void flipCapLockState() {

repaint();

analyticService.trackCapLockFlipToggle();
logger.log(Level.INFO, "Reset caps lock");
}

Expand Down Expand Up @@ -289,8 +286,6 @@ public void showCapsLockStatusPopup() {
hidePopup();
}
repaint();

analyticService.trackCapLockToggle();
}

private void showSuccessStatusPopup() {
Expand Down Expand Up @@ -339,8 +334,6 @@ private void quickFixUpperCaseText() {

showSuccessStatusPopup();
}

analyticService.trackCapLockQuickFix();
}

private void hidePopup() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/co/uk/bittwisted/service/AnalyticService.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Optional;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

// TODO: Not in use as G4A requires user consent before posting events
public class AnalyticService {
private final Properties defaultProperties;
private final Logger logger = Logger.getLogger(AnalyticService.class.getName());

public AnalyticService(String clientId) {
defaultProperties = new Properties();
defaultProperties.setProperty("t", "event");
defaultProperties.setProperty("tid", "UA-98191047-2");
defaultProperties.setProperty("tid", "G-YMBFYFX9WY");
defaultProperties.setProperty("cid", clientId);
defaultProperties.setProperty("ev", "1");
}
Expand Down

0 comments on commit ccde1b7

Please sign in to comment.