UmiJSUmiJS
  • Introduce
  • Guide
  • API
  • Umi Max
  • Blog
⌘ K
中文
Umi Max Introduction
Layout and Menu
antd
Charts
Data Stream
Request
Permissions
Internationalization
Micro Frontends
styled-components
react-query
valtio
dva
Site Statistics
Module Federation Plugin
Last updated:
Open-source MIT Licensed | Copyright © 2017-present

TABLE OF CONTENTS

Site Statistics

@umijs/max has built-in site statistics functionality, currently supporting Google Analytics and Baidu Analytics

How to Enable

Configure it to be enabled and enter the respective analytics service key as required.

Example:

{
analytics: {
ga_v2: 'G-abcdefg', // google analytics key (GA 4)
baidu: 'baidu_tongji_key',
// If you are using the old version GA v1, please use `ga` to configure
ga: 'ga_old_key'
}
}

Environment Variables

The key for Google Analytics 4 can also be configured through the environment variable GA_V2_KEY, and the old version uses GA_KEY.