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 configurega: '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
.