百度:为vue站添加百度统计
一,登录百度统计获取统计代码:
使用设置->网站列表->新增网站:
填写数据后点确定:
配置单页:
复制代码:
二,添加代码到vue的html页面
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
<! DOCTYPE html> < html lang = "en" > < head > < meta charset = "utf-8" /> < meta http-equiv = "X-UA-Compatible" content = "IE=edge" /> < meta name = "viewport" content = "width=device-width,initial-scale=1.0" /> < meta name = "keywords" content = "" /> < meta name = "description" content = "" /> < link rel = "icon" href="<%= BASE_URL %>favicon.ico" /> < title ><%= htmlWebpackPlugin.options.title %></ title > <% if (process.env.NODE_ENV === 'production' ) { %> < script > var _hmt = _hmt || []; </ script > <% } %> </ head > < body > < noscript > < strong >We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</ strong > </ noscript > < div id = "app" ></ div > <!-- built files will be auto injected --> <% if (process.env.NODE_ENV === 'production' ) { %> < script > var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?xxxxxxxxxxxxxxxxxxx"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </ script > <% } %> </ body > </ html > |
然后打包上传到服务器
liuhongdi@lhdpc:/data/vue/touch$ npm run build
说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/08/28/bai-du-wei-vue-zhan-tian-jia-bai-du-tong-ji/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: 371125307@qq.com
三,测试效果:
可以看到代码安装正确无问题
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
2020-08-28 spring boot:spring security给用户登录增加自动登录及图形验证码功能(spring boot 2.3.1)
2020-08-28 spring boot:spring security用mysql数据库实现RBAC权限管理(spring boot 2.3.1)