Skip to content

Commit 2f44215

Browse files
author
lrhh123
committed
rm: 删除谷歌埋点
1 parent e0e888f commit 2f44215

File tree

10 files changed

+22
-21
lines changed

10 files changed

+22
-21
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
"pg-hstore": "^2.3.4",
132132
"react": "^18.2.0",
133133
"react-dom": "^18.2.0",
134-
"react-ga4": "^2.1.0",
135134
"react-hook-form": "^7.50.1",
136135
"react-icons": "^5.0.1",
137136
"react-markdown": "^9.0.1",

pnpm-lock.yaml

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/index.ejs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<head>
55
<meta charset="utf-8" />
66
<title>懒人客服</title>
7+
<script defer src="https://anl.wizgadg.top/script.js" data-website-id="eb4d2b94-6054-454d-8369-d4f443f75a99"></script>
78
</head>
89

910
<body>

src/renderer/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import React from 'react';
22
import { createRoot } from 'react-dom/client';
3-
import ReactGA from 'react-ga4';
43
import App from './App';
5-
import { trackingID } from './services/analytics';
64

7-
ReactGA.initialize(trackingID);
85
const container = document.getElementById('root') as HTMLElement;
96
const root = createRoot(container);
107
root.render(

src/renderer/pages/About/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react';
1+
import React, { useState, useEffect } from 'react';
22
import {
33
Box,
44
Button,
@@ -17,6 +17,7 @@ import {
1717
import PageContainer from '../../components/PageContainer';
1818
import Markdown from '../../components/Markdown';
1919
import { getVersionInfo } from '../../services/system/controller';
20+
import { trackPageView } from '../../services/analytics';
2021

2122
const AboutPage: React.FC = () => {
2223
const toast = useToast();
@@ -55,6 +56,10 @@ const AboutPage: React.FC = () => {
5556
}
5657
};
5758

59+
useEffect(() => {
60+
trackPageView('AboutPage');
61+
}, []);
62+
5863
return (
5964
<PageContainer>
6065
<VStack>

src/renderer/pages/ChatSessionsTable/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
getPlatformList,
4040
exportMessageExcel,
4141
} from '../../services/platform/controller';
42+
import { trackPageView } from '../../services/analytics';
4243

4344
const ChatSessionsTable = () => {
4445
const toast = useToast();
@@ -57,6 +58,10 @@ const ChatSessionsTable = () => {
5758
const [updated, setUpdated] = useState(false);
5859
const itemsPerPage = 10; // 每一页显示的条数
5960

61+
useEffect(() => {
62+
trackPageView('ChatSessionsTable');
63+
}, []);
64+
6065
useEffect(() => {
6166
const fetchSessions = async () => {
6267
try {

src/renderer/pages/Home/AppManager/InstanceListComponent.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import { AddIcon } from '@chakra-ui/icons';
1313
import InstanceCardComponent from './InstanceCardComponent';
1414
import { useAppManager } from './AppManagerContext';
15+
import { trackButtonClick } from '../../../services/analytics';
1516

1617
const InstanceListComponent = () => {
1718
const {
@@ -37,6 +38,7 @@ const InstanceListComponent = () => {
3738

3839
const handleAddTaskWrapper = async () => {
3940
try {
41+
trackButtonClick(`add_task_${selectedAppId || ''}`);
4042
await handleAddTask();
4143
} catch (error) {
4244
toast({

src/renderer/pages/Home/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import LogBox from './LogBox';
1717

1818
const HomePage = () => {
1919
useEffect(() => {
20-
// 页面访问埋点
2120
trackPageView('Home');
2221
}, []);
2322

src/renderer/pages/Settings/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { useEffect } from 'react';
22
import {
33
ChakraProvider,
44
Flex,
@@ -12,8 +12,13 @@ import AccountSettings from '../../components/Settings/AccountSettings';
1212
import GeneralSettings from '../../components/Settings/GeneralSettings';
1313
import LLMSettings from '../../components/Settings/LLMSettings';
1414
import PluginSettings from '../../components/Settings/PluginSettings';
15+
import { trackPageView } from '../../services/analytics';
1516

1617
const SettingsPage = () => {
18+
useEffect(() => {
19+
trackPageView('Settings');
20+
}, []);
21+
1722
return (
1823
<ChakraProvider>
1924
<Flex direction="column" height="70vh">

src/renderer/services/analytics/index_template.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
import ua from 'universal-analytics';
2-
3-
// 这里使用了 Google Analytics 的跟踪 ID,如果不使用,可以直接注释掉相关代码,Mock 掉相关函数
4-
const trackingID = 'UA-XXXXXXXXX-X';
5-
const visitor = ua(trackingID);
6-
1+
/* eslint-disable @typescript-eslint/no-unused-vars */
72
export function sendEvent(
83
category: string,
94
action: string,
105
label: string,
116
value: string | number,
127
) {
13-
visitor.event(category, action, label, value).send();
8+
// visitor.event(category, action, label, value).send();
149
}
1510

1611
// 预制事件:打开按钮

0 commit comments

Comments
 (0)