Commit 19f5cc1
authored
feat(customers): Add B2B mode to customer analytics dashboard (#42159)
## Problem
Customer Analytics currently only supports B2C analytics. Let's enable B2B analytics too.
Closes #41545
## Changes
- Added B2B/B2C toggle in the Customer Analytics filters
- Implemented group type selection dropdown for B2B mode
- Updated all insights to support both B2C (person-based) and B2B (group-based) analytics
- Added support for weekly and monthly active groups in the MathTag component
- Dynamically updated labels throughout the UI to reflect the selected business type (users vs. groups)
- Fixed tooltip configuration in LineGraph component
### B2C selected
<img width="1624" height="979" alt="image" src="https://github.com/user-attachments/assets/a669cc77-c52b-40df-8273-f548aeec8a59" />
### B2B selected
Insights reflect the selected group type
<img width="1624" height="979" alt="image" src="https://github.com/user-attachments/assets/db0aabf1-bd40-46f9-ac9d-8235d6af2d7b" />
### Group selector
<img width="1624" height="979" alt="image" src="https://github.com/user-attachments/assets/41c90b5e-ddf2-4c36-bf47-b4101b795a7a" />
## How did you test this code?
- Tested switching between B2C and B2B modes and verified all insights update correctly
- Verified group selection dropdown works and updates all insights
- Confirmed that labels dynamically update based on the selected business type
- Tested with various group types to ensure proper display of metrics
- Verified that the B2B option is disabled when group analytics is not enabled
## Changelog: (features only) Is this feature complete?
No, under feature flag1 parent f6d2b99 commit 19f5cc1
File tree
6 files changed
+234
-59
lines changed- frontend/src
- lib/components/InsightLabel
- scenes/insights/views/LineGraph
- products/customer_analytics/frontend
- components
- Insights
6 files changed
+234
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| 790 | + | |
790 | 791 | | |
791 | 792 | | |
792 | 793 | | |
793 | 794 | | |
794 | 795 | | |
795 | 796 | | |
796 | 797 | | |
797 | | - | |
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
| |||
Lines changed: 34 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
91 | 116 | | |
92 | 117 | | |
93 | 118 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | | - | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
68 | | - | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| |||
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
92 | | - | |
93 | | - | |
| 97 | + | |
| 98 | + | |
94 | 99 | | |
95 | 100 | | |
96 | 101 | | |
| |||
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| 107 | + | |
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
| |||
0 commit comments