-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
🚀 Feature Request: 支持 auto_route 页面跳转的自动埋点识别
背景说明
当前在 Flutter 项目中集成了神策官方插件,并启用了自动埋点配置 SAAutoTrackConfig,通过如下方式初始化页面配置:
SAAutoTrackPageConfig<CouponListPage>(
title: '优惠券列表',
screenName: 'CouponList',
properties: {'page': 'coupon_list'},
),在使用原生 Navigator 进行页面跳转时,可以正常识别页面信息并上报 $AppViewScreen 事件:
Navigator.of(context).push(MaterialPageRoute(builder: (context) => const CouponListPage()));正常上报示例(Navigator 跳转):
"event": "$AppViewScreen",
"lib": {
"$lib_detail": "CouponList######"
},
"properties": {
"$title": "优惠券列表",
"$screen_name": "CouponList",
"page": "coupon_list"
}问题说明
项目中实际采用 [auto_route](https://pub.dev/packages/auto_route)(版本:`^9.2.2`) 进行路由管理。在使用 auto_route 进行页面跳转时,神策未能正确读取到 SAAutoTrackPageConfig 中的配置信息。
当前行为(auto_route 跳转):
"event": "$AppViewScreen",
"lib": {
"$lib_detail": "RouteDataScope######"
},
"properties": {
"$title": "My Coupons",
"$screen_name": "RouteDataScope"
}可以看到页面识别为 RouteDataScope,未读取 SAAutoTrackPageConfig 的配置。
对比参考
使用 firebase_analytics 插件时,可以正确识别 auto_route 的页面类,并上报对应路径。
期望行为
希望官方插件在自动埋点中:
- 支持 auto_route 管理的页面跳转;
- 自动读取并匹配
SAAutoTrackPageConfig中配置的信息; - 使页面浏览事件
$AppViewScreen上报时包含开发者预设的title、screenName、properties等字段;
环境信息
- Flutter
- 插件版本:
sensors_analytics_flutter_plugin - auto_route:
^9.2.2 - firebase_analytics:
^11.4.5
如需我协助提供 Demo 项目或更多测试数据,也欢迎联系!
Metadata
Metadata
Assignees
Labels
No labels
