Skip to content

Commit

Permalink
added talking data analytics tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Sep 18, 2019
1 parent 82b609c commit 1d8a572
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
3 changes: 2 additions & 1 deletion config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ export const apiEndpoint = 'http://localhost:3000';

export default {
plugins,
history: 'hash',
block: {
defaultGitUrl: 'https://github.com/ant-design/pro-blocks',
defaultGitUrl: 'https://github.com/crawlab-team/artipub',
},
hash: true,
targets: {
Expand Down
4 changes: 2 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Ant Design Pro",
"short_name": "Ant Design Pro",
"name": "ArtiPub",
"short_name": "ArtiPub",
"display": "standalone",
"start_url": "./?utm_source=homescreen",
"theme_color": "#002140",
Expand Down
2 changes: 2 additions & 0 deletions src/pages/ArticleList/ArticleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ const ArticleList: React.FC<ArticleListProps> = props => {
);
}

TDAPP.onEvent('文章管理-访问页面');

return (
<PageHeaderWrapper>
<Modal
Expand Down
5 changes: 5 additions & 0 deletions src/pages/PlatformList/PlatformList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const PlatformList: React.FC<PlatformListProps> = props => {
type: 'platform/saveCurrentPlatform',
payload: d,
});
TDAPP.onEvent('平台管理-打开账户设置')
};
};

Expand All @@ -174,6 +175,7 @@ const PlatformList: React.FC<PlatformListProps> = props => {
type: 'platform/saveAccountModalVisible',
payload: false,
});
TDAPP.onEvent('平台管理-取消账户设置')
};

const onAccountSave = async () => {
Expand All @@ -185,6 +187,7 @@ const PlatformList: React.FC<PlatformListProps> = props => {
type: 'platform/saveAccountModalVisible',
payload: false,
});
TDAPP.onEvent('平台管理-保存账户设置')
};

const getStatsComponent = (d: any) => {
Expand Down Expand Up @@ -436,6 +439,8 @@ const PlatformList: React.FC<PlatformListProps> = props => {
}
}, []);

TDAPP.onEvent('平台管理-访问页面');

return (
<PageHeaderWrapper>
<Modal
Expand Down
3 changes: 2 additions & 1 deletion src/pages/document.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
/>
<title>Ant Design Pro</title>
<title>ArtiPub</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<script src="http://sdk.talkingdata.com/app/h5/v1?appid=378E36452AF64EDCA6EF5EAAF53A7993&vn=0.1.1&vc=0.1.1"></script>
</head>
<body>
<noscript>Sorry, we need js to run correctly!</noscript>
Expand Down
6 changes: 6 additions & 0 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ declare let ga: Function;
// preview.pro.ant.design only do not use in your production ;
// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
declare let ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: 'site' | undefined;

interface ITDAPP {
onEvent: (eventLabel: string) => {};
}

declare let TDAPP: ITDAPP;

0 comments on commit 1d8a572

Please sign in to comment.