@backstage-community/plugin-analytics-module-matomo 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +259 -0
- package/README.md +64 -0
- package/config.d.ts +34 -0
- package/dist/api/Matomo.esm.js +35 -0
- package/dist/api/Matomo.esm.js.map +1 -0
- package/dist/api/loadMatomo.esm.js +22 -0
- package/dist/api/loadMatomo.esm.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.esm.js +3 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/plugin.esm.js +8 -0
- package/dist/plugin.esm.js.map +1 -0
- package/package.json +71 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
### Dependencies
|
|
2
|
+
|
|
3
|
+
## 1.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 883e289: Migrate matomo analytics provider from janus to backstage community-plugins.
|
|
8
|
+
|
|
9
|
+
## 1.8.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 0e6bfd3: feat: update Backstage to the latest version
|
|
14
|
+
|
|
15
|
+
Update to Backstage 1.32.5
|
|
16
|
+
|
|
17
|
+
## 1.8.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- 8244f28: chore(deps): update to backstage 1.32
|
|
22
|
+
|
|
23
|
+
## 1.7.1
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- 7342e9b: chore: remove @janus-idp/cli dep and relink local packages
|
|
28
|
+
|
|
29
|
+
This update removes `@janus-idp/cli` from all plugins, as it’s no longer necessary. Additionally, packages are now correctly linked with a specified version.
|
|
30
|
+
|
|
31
|
+
## 1.7.0
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- d9551ae: feat(deps): update to backstage 1.31
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- d9551ae: Change local package references to a `*`
|
|
40
|
+
- d9551ae: pin the @janus-idp/cli package
|
|
41
|
+
- d9551ae: upgrade to yarn v3
|
|
42
|
+
|
|
43
|
+
* **@janus-idp/cli:** upgraded to 1.15.2
|
|
44
|
+
|
|
45
|
+
### Dependencies
|
|
46
|
+
|
|
47
|
+
- **@janus-idp/cli:** upgraded to 1.15.1
|
|
48
|
+
|
|
49
|
+
### Dependencies
|
|
50
|
+
|
|
51
|
+
- **@janus-idp/cli:** upgraded to 1.15.0
|
|
52
|
+
|
|
53
|
+
### Dependencies
|
|
54
|
+
|
|
55
|
+
- **@janus-idp/cli:** upgraded to 1.14.0
|
|
56
|
+
|
|
57
|
+
### Dependencies
|
|
58
|
+
|
|
59
|
+
- **@janus-idp/cli:** upgraded to 1.13.2
|
|
60
|
+
|
|
61
|
+
### Dependencies
|
|
62
|
+
|
|
63
|
+
- **@janus-idp/cli:** upgraded to 1.13.1
|
|
64
|
+
|
|
65
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.5.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.4.0...@janus-idp/backstage-plugin-analytics-module-matomo@1.5.0) (2024-07-25)
|
|
66
|
+
|
|
67
|
+
### Features
|
|
68
|
+
|
|
69
|
+
- **deps:** update to backstage 1.29 ([#1900](https://github.com/janus-idp/backstage-plugins/issues/1900)) ([f53677f](https://github.com/janus-idp/backstage-plugins/commit/f53677fb02d6df43a9de98c43a9f101a6db76802))
|
|
70
|
+
|
|
71
|
+
### Dependencies
|
|
72
|
+
|
|
73
|
+
- **@janus-idp/cli:** upgraded to 1.13.0
|
|
74
|
+
|
|
75
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.4.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.3.1...@janus-idp/backstage-plugin-analytics-module-matomo@1.4.0) (2024-07-23)
|
|
76
|
+
|
|
77
|
+
### Features
|
|
78
|
+
|
|
79
|
+
- **deps:** update to backstage 1.28 ([#1891](https://github.com/janus-idp/backstage-plugins/issues/1891)) ([1ba1108](https://github.com/janus-idp/backstage-plugins/commit/1ba11088e0de60e90d138944267b83600dc446e5))
|
|
80
|
+
|
|
81
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.3.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.3.0...@janus-idp/backstage-plugin-analytics-module-matomo@1.3.1) (2024-06-19)
|
|
82
|
+
|
|
83
|
+
### Dependencies
|
|
84
|
+
|
|
85
|
+
- **@janus-idp/cli:** upgraded to 1.11.1
|
|
86
|
+
|
|
87
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.3.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.11...@janus-idp/backstage-plugin-analytics-module-matomo@1.3.0) (2024-06-13)
|
|
88
|
+
|
|
89
|
+
### Features
|
|
90
|
+
|
|
91
|
+
- **deps:** update to backstage 1.27 ([#1683](https://github.com/janus-idp/backstage-plugins/issues/1683)) ([a14869c](https://github.com/janus-idp/backstage-plugins/commit/a14869c3f4177049cb8d6552b36c3ffd17e7997d))
|
|
92
|
+
|
|
93
|
+
### Dependencies
|
|
94
|
+
|
|
95
|
+
- **@janus-idp/cli:** upgraded to 1.11.0
|
|
96
|
+
|
|
97
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.11](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.10...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.11) (2024-06-13)
|
|
98
|
+
|
|
99
|
+
### Dependencies
|
|
100
|
+
|
|
101
|
+
- **@janus-idp/cli:** upgraded to 1.10.1
|
|
102
|
+
|
|
103
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.10](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.9...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.10) (2024-06-05)
|
|
104
|
+
|
|
105
|
+
### Dependencies
|
|
106
|
+
|
|
107
|
+
- **@janus-idp/cli:** upgraded to 1.10.0
|
|
108
|
+
|
|
109
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.9](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.8...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.9) (2024-06-04)
|
|
110
|
+
|
|
111
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.8](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.7...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.8) (2024-06-04)
|
|
112
|
+
|
|
113
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.7](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.6...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.7) (2024-06-03)
|
|
114
|
+
|
|
115
|
+
### Dependencies
|
|
116
|
+
|
|
117
|
+
- **@janus-idp/cli:** upgraded to 1.9.0
|
|
118
|
+
|
|
119
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.6](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.5...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.6) (2024-05-31)
|
|
120
|
+
|
|
121
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.5](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.4...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.5) (2024-05-29)
|
|
122
|
+
|
|
123
|
+
### Dependencies
|
|
124
|
+
|
|
125
|
+
- **@janus-idp/cli:** upgraded to 1.8.10
|
|
126
|
+
|
|
127
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.4](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.3...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.4) (2024-05-29)
|
|
128
|
+
|
|
129
|
+
### Dependencies
|
|
130
|
+
|
|
131
|
+
- **@janus-idp/cli:** upgraded to 1.8.9
|
|
132
|
+
|
|
133
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.3](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.2...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.3) (2024-05-28)
|
|
134
|
+
|
|
135
|
+
### Dependencies
|
|
136
|
+
|
|
137
|
+
- **@janus-idp/cli:** upgraded to 1.8.8
|
|
138
|
+
|
|
139
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.1...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.2) (2024-05-16)
|
|
140
|
+
|
|
141
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.2.0...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.1) (2024-05-16)
|
|
142
|
+
|
|
143
|
+
### Dependencies
|
|
144
|
+
|
|
145
|
+
- **@janus-idp/cli:** upgraded to 1.8.7
|
|
146
|
+
|
|
147
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.2.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.13...@janus-idp/backstage-plugin-analytics-module-matomo@1.2.0) (2024-05-14)
|
|
148
|
+
|
|
149
|
+
### Features
|
|
150
|
+
|
|
151
|
+
- **deps:** use RHDH themes in the backstage app and dev pages ([#1480](https://github.com/janus-idp/backstage-plugins/issues/1480)) ([8263bf0](https://github.com/janus-idp/backstage-plugins/commit/8263bf099736cbb0d0f2316082d338ba81fa6927))
|
|
152
|
+
|
|
153
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.13](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.12...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.13) (2024-05-09)
|
|
154
|
+
|
|
155
|
+
### Dependencies
|
|
156
|
+
|
|
157
|
+
- **@janus-idp/cli:** upgraded to 1.8.6
|
|
158
|
+
|
|
159
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.12](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.11...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.12) (2024-05-02)
|
|
160
|
+
|
|
161
|
+
### Dependencies
|
|
162
|
+
|
|
163
|
+
- **@janus-idp/cli:** upgraded to 1.8.5
|
|
164
|
+
|
|
165
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.11](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.10...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.11) (2024-05-02)
|
|
166
|
+
|
|
167
|
+
### Dependencies
|
|
168
|
+
|
|
169
|
+
- **@janus-idp/cli:** upgraded to 1.8.4
|
|
170
|
+
|
|
171
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.10](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.9...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.10) (2024-04-30)
|
|
172
|
+
|
|
173
|
+
### Dependencies
|
|
174
|
+
|
|
175
|
+
- **@janus-idp/cli:** upgraded to 1.8.3
|
|
176
|
+
|
|
177
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.9](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.8...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.9) (2024-04-30)
|
|
178
|
+
|
|
179
|
+
### Dependencies
|
|
180
|
+
|
|
181
|
+
- **@janus-idp/cli:** upgraded to 1.8.2
|
|
182
|
+
|
|
183
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.8](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.7...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.8) (2024-04-25)
|
|
184
|
+
|
|
185
|
+
### Dependencies
|
|
186
|
+
|
|
187
|
+
- **@janus-idp/cli:** upgraded to 1.8.1
|
|
188
|
+
|
|
189
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.7](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.6...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.7) (2024-04-15)
|
|
190
|
+
|
|
191
|
+
### Dependencies
|
|
192
|
+
|
|
193
|
+
- **@janus-idp/cli:** upgraded to 1.8.0
|
|
194
|
+
|
|
195
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.6](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.5...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.6) (2024-04-09)
|
|
196
|
+
|
|
197
|
+
### Dependencies
|
|
198
|
+
|
|
199
|
+
- **@janus-idp/cli:** upgraded to 1.7.10
|
|
200
|
+
|
|
201
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.5](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.4...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.5) (2024-04-09)
|
|
202
|
+
|
|
203
|
+
### Dependencies
|
|
204
|
+
|
|
205
|
+
- **@janus-idp/cli:** upgraded to 1.7.9
|
|
206
|
+
|
|
207
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.4](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.3...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.4) (2024-04-05)
|
|
208
|
+
|
|
209
|
+
### Dependencies
|
|
210
|
+
|
|
211
|
+
- **@janus-idp/cli:** upgraded to 1.7.8
|
|
212
|
+
|
|
213
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.3](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.2...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.3) (2024-04-02)
|
|
214
|
+
|
|
215
|
+
### Dependencies
|
|
216
|
+
|
|
217
|
+
- **@janus-idp/cli:** upgraded to 1.7.7
|
|
218
|
+
|
|
219
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.1...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.2) (2024-03-29)
|
|
220
|
+
|
|
221
|
+
### Dependencies
|
|
222
|
+
|
|
223
|
+
- **@janus-idp/cli:** upgraded to 1.7.6
|
|
224
|
+
|
|
225
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.1.0...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.1) (2024-03-15)
|
|
226
|
+
|
|
227
|
+
### Bug Fixes
|
|
228
|
+
|
|
229
|
+
- **matomo-analytics:** event trigger on load ([#1341](https://github.com/janus-idp/backstage-plugins/issues/1341)) ([3bc11f3](https://github.com/janus-idp/backstage-plugins/commit/3bc11f318d012d7a2aa43b4928891c138ee2a5d9))
|
|
230
|
+
|
|
231
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.1.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.0.4...@janus-idp/backstage-plugin-analytics-module-matomo@1.1.0) (2024-03-15)
|
|
232
|
+
|
|
233
|
+
### Features
|
|
234
|
+
|
|
235
|
+
- **matomo-analytics:** export apifactory for dynamic plugin ([#1329](https://github.com/janus-idp/backstage-plugins/issues/1329)) ([c687617](https://github.com/janus-idp/backstage-plugins/commit/c6876177f062878801e798ea0193126a28f9fa08))
|
|
236
|
+
|
|
237
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.0.4](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.0.3...@janus-idp/backstage-plugin-analytics-module-matomo@1.0.4) (2024-02-22)
|
|
238
|
+
|
|
239
|
+
### Documentation
|
|
240
|
+
|
|
241
|
+
- **matomo-plugin:** fix config example and replace GA with Matomo ([#991](https://github.com/janus-idp/backstage-plugins/issues/991)) ([55d6048](https://github.com/janus-idp/backstage-plugins/commit/55d6048c3490dfc6db9a3ebc4103ed505eeaaaf4))
|
|
242
|
+
|
|
243
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.0.3](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.0.2...@janus-idp/backstage-plugin-analytics-module-matomo@1.0.3) (2024-02-21)
|
|
244
|
+
|
|
245
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo 1.0.0 (2023-10-30)
|
|
246
|
+
|
|
247
|
+
### Features
|
|
248
|
+
|
|
249
|
+
- **matomo:** analytics module plugin for matomo ([#837](https://github.com/janus-idp/backstage-plugins/issues/837)) ([8c497fc](https://github.com/janus-idp/backstage-plugins/commit/8c497fcd588c492f4d21bb686bcdd796691f0c90))
|
|
250
|
+
|
|
251
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.0.2](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.0.1...@janus-idp/backstage-plugin-analytics-module-matomo@1.0.2) (2023-10-19)
|
|
252
|
+
|
|
253
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo [1.0.1](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/backstage-plugin-analytics-module-matomo@1.0.0...@janus-idp/backstage-plugin-analytics-module-matomo@1.0.1) (2023-10-19)
|
|
254
|
+
|
|
255
|
+
## @janus-idp/backstage-plugin-analytics-module-matomo 1.0.0 (2023-10-17)
|
|
256
|
+
|
|
257
|
+
### Features
|
|
258
|
+
|
|
259
|
+
- **matomo:** analytics module plugin for matomo ([#837](https://github.com/janus-idp/backstage-plugins/issues/837)) ([8c497fc](https://github.com/janus-idp/backstage-plugins/commit/8c497fcd588c492f4d21bb686bcdd796691f0c90))
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Analytics Module: Matomo Analytics
|
|
2
|
+
|
|
3
|
+
This plugin provides an opinionated implementation of the Backstage Analytics
|
|
4
|
+
API for Matomo Analytics. Once installed and configured, analytics events will
|
|
5
|
+
be sent to Matomo as your users navigate and use your Backstage instance.
|
|
6
|
+
|
|
7
|
+
This module is made to work with backstage's built-in analytics plugin. The usage guide to start tracking analytics for your plugins can be found here: https://backstage.io/docs/plugins/analytics/
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
1. Install the plugin package in your Backstage app:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
# From your Backstage root directory
|
|
15
|
+
yarn workspace app add @backstage-community/plugin-analytics-module-matomo
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. Wire up the API implementation to your App:
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
// packages/app/src/apis.ts
|
|
22
|
+
import {
|
|
23
|
+
analyticsApiRef,
|
|
24
|
+
configApiRef,
|
|
25
|
+
identityApiRef,
|
|
26
|
+
} from '@backstage/core-plugin-api';
|
|
27
|
+
|
|
28
|
+
import { MatomoAnalytics } from '@backstage-community/plugin-analytics-module-matomo';
|
|
29
|
+
|
|
30
|
+
export const apis: AnyApiFactory[] = [
|
|
31
|
+
// Instantiate and register the Matomo Analytics API Implementation.
|
|
32
|
+
createApiFactory({
|
|
33
|
+
api: analyticsApiRef,
|
|
34
|
+
deps: { configApi: configApiRef },
|
|
35
|
+
factory: ({ configApi }) => MatomoAnalytics.fromConfig(configApi),
|
|
36
|
+
}),
|
|
37
|
+
];
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
3. Configure the plugin in your `app-config.yaml`:
|
|
41
|
+
|
|
42
|
+
The following is the minimum configuration required to start sending analytics
|
|
43
|
+
events to Matomo. All that's needed is your Matomo Host and Site Id:
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
# app-config.yaml
|
|
47
|
+
app:
|
|
48
|
+
analytics:
|
|
49
|
+
matomo:
|
|
50
|
+
host: ${ANALYTICS_MATOMO_INSTANCE_URL}
|
|
51
|
+
siteId: ${ANALYTICS_MATOMO_SITE_ID}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
4. Update CSP in your `app-config.yaml`:(optional)
|
|
55
|
+
|
|
56
|
+
The following is the minimal content security policy required to load scripts from your Matomo Instance.
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
backend:
|
|
60
|
+
csp:
|
|
61
|
+
connect-src: ["'self'", 'http:', 'https:']
|
|
62
|
+
# Add these line below
|
|
63
|
+
script-src: ["'self'", "'unsafe-eval'", '${ANALYTICS_MATOMO_INSTANCE_URL}']
|
|
64
|
+
```
|
package/config.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 The Backstage Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export interface Config {
|
|
17
|
+
app?: {
|
|
18
|
+
analytics: {
|
|
19
|
+
matomo: {
|
|
20
|
+
/**
|
|
21
|
+
* Matomo host URL
|
|
22
|
+
* @visibility frontend
|
|
23
|
+
*/
|
|
24
|
+
host: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Matomo siteId for the Backstage Website
|
|
28
|
+
* @visibility frontend
|
|
29
|
+
*/
|
|
30
|
+
siteId: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createApiFactory, analyticsApiRef, configApiRef } from '@backstage/core-plugin-api';
|
|
2
|
+
import { loadMatomo } from './loadMatomo.esm.js';
|
|
3
|
+
|
|
4
|
+
class MatomoAnalytics {
|
|
5
|
+
configApi;
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.configApi = options.configApi;
|
|
8
|
+
const matomoUrl = this.configApi.getString("app.analytics.matomo.host");
|
|
9
|
+
const matomoSiteId = this.configApi.getNumber(
|
|
10
|
+
"app.analytics.matomo.siteId"
|
|
11
|
+
);
|
|
12
|
+
loadMatomo(matomoUrl, matomoSiteId);
|
|
13
|
+
}
|
|
14
|
+
static fromConfig(config) {
|
|
15
|
+
return new MatomoAnalytics({ configApi: config });
|
|
16
|
+
}
|
|
17
|
+
captureEvent(event) {
|
|
18
|
+
const { context, action, subject, value } = event;
|
|
19
|
+
window._paq.push([
|
|
20
|
+
"trackEvent",
|
|
21
|
+
context.extension || "App",
|
|
22
|
+
action,
|
|
23
|
+
subject,
|
|
24
|
+
value
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const MatomoAnalyticsApi = createApiFactory({
|
|
29
|
+
api: analyticsApiRef,
|
|
30
|
+
deps: { configApi: configApiRef },
|
|
31
|
+
factory: ({ configApi }) => MatomoAnalytics.fromConfig(configApi)
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export { MatomoAnalytics, MatomoAnalyticsApi };
|
|
35
|
+
//# sourceMappingURL=Matomo.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Matomo.esm.js","sources":["../../src/api/Matomo.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n AnalyticsApi,\n AnalyticsEvent,\n ConfigApi,\n analyticsApiRef,\n configApiRef,\n createApiFactory,\n} from '@backstage/core-plugin-api';\n\nimport { loadMatomo } from './loadMatomo';\n\ndeclare const window: Window &\n typeof globalThis & {\n _paq: any[];\n };\n\ntype Options = {\n configApi: ConfigApi;\n};\n\n/**\n * @public\n */\nexport class MatomoAnalytics implements AnalyticsApi {\n private readonly configApi: ConfigApi;\n\n private constructor(options: Options) {\n this.configApi = options.configApi;\n const matomoUrl = this.configApi.getString('app.analytics.matomo.host');\n const matomoSiteId = this.configApi.getNumber(\n 'app.analytics.matomo.siteId',\n );\n loadMatomo(matomoUrl, matomoSiteId);\n }\n\n static fromConfig(config: ConfigApi) {\n return new MatomoAnalytics({ configApi: config });\n }\n\n captureEvent(event: AnalyticsEvent) {\n const { context, action, subject, value } = event;\n // REF: https://github.com/backstage/community-plugins/blob/main/workspaces/analytics/plugins/analytics-module-ga/src/apis/implementations/AnalyticsApi/GoogleAnalytics.ts#L160\n // REF: https://matomo.org/faq/reports/implement-event-tracking-with-matomo/\n window._paq.push([\n 'trackEvent',\n context.extension || 'App',\n action,\n subject,\n value,\n ]);\n }\n}\n\n/**\n * Api factory method for matomo\n * @public\n */\nexport const MatomoAnalyticsApi = createApiFactory({\n api: analyticsApiRef,\n deps: { configApi: configApiRef },\n factory: ({ configApi }) => MatomoAnalytics.fromConfig(configApi),\n});\n"],"names":[],"mappings":";;;AAsCO,MAAM,eAAwC,CAAA;AAAA,EAClC,SAAA,CAAA;AAAA,EAET,YAAY,OAAkB,EAAA;AACpC,IAAA,IAAA,CAAK,YAAY,OAAQ,CAAA,SAAA,CAAA;AACzB,IAAA,MAAM,SAAY,GAAA,IAAA,CAAK,SAAU,CAAA,SAAA,CAAU,2BAA2B,CAAA,CAAA;AACtE,IAAM,MAAA,YAAA,GAAe,KAAK,SAAU,CAAA,SAAA;AAAA,MAClC,6BAAA;AAAA,KACF,CAAA;AACA,IAAA,UAAA,CAAW,WAAW,YAAY,CAAA,CAAA;AAAA,GACpC;AAAA,EAEA,OAAO,WAAW,MAAmB,EAAA;AACnC,IAAA,OAAO,IAAI,eAAA,CAAgB,EAAE,SAAA,EAAW,QAAQ,CAAA,CAAA;AAAA,GAClD;AAAA,EAEA,aAAa,KAAuB,EAAA;AAClC,IAAA,MAAM,EAAE,OAAA,EAAS,MAAQ,EAAA,OAAA,EAAS,OAAU,GAAA,KAAA,CAAA;AAG5C,IAAA,MAAA,CAAO,KAAK,IAAK,CAAA;AAAA,MACf,YAAA;AAAA,MACA,QAAQ,SAAa,IAAA,KAAA;AAAA,MACrB,MAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAA;AAMO,MAAM,qBAAqB,gBAAiB,CAAA;AAAA,EACjD,GAAK,EAAA,eAAA;AAAA,EACL,IAAA,EAAM,EAAE,SAAA,EAAW,YAAa,EAAA;AAAA,EAChC,SAAS,CAAC,EAAE,WAAgB,KAAA,eAAA,CAAgB,WAAW,SAAS,CAAA;AAClE,CAAC;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
let isInitialized = false;
|
|
2
|
+
const loadMatomo = (matomoUrl, siteId) => {
|
|
3
|
+
if (isInitialized) return;
|
|
4
|
+
const _paq = window._paq = window._paq || [];
|
|
5
|
+
_paq.push(["trackPageView"]);
|
|
6
|
+
_paq.push(["enableLinkTracking"]);
|
|
7
|
+
(() => {
|
|
8
|
+
const u = `//${matomoUrl}/`;
|
|
9
|
+
_paq.push(["setTrackerUrl", `${u}matomo.php`]);
|
|
10
|
+
_paq.push(["setSiteId", siteId]);
|
|
11
|
+
const d = document;
|
|
12
|
+
const g = d.createElement("script");
|
|
13
|
+
const s = d.getElementsByTagName("script")[0];
|
|
14
|
+
g.async = true;
|
|
15
|
+
g.src = `${u}matomo.js`;
|
|
16
|
+
s.parentNode?.insertBefore(g, s);
|
|
17
|
+
})();
|
|
18
|
+
isInitialized = true;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { loadMatomo };
|
|
22
|
+
//# sourceMappingURL=loadMatomo.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadMatomo.esm.js","sources":["../../src/api/loadMatomo.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nlet isInitialized = false;\nexport const loadMatomo = (matomoUrl: string, siteId: number) => {\n /* Only initialize matomo tracker if it's not loaded */\n if (isInitialized) return;\n\n const _paq = ((window as any)._paq = (window as any)._paq || []);\n /* tracker methods like \"setCustomDimension\" should be called before \"trackPageView\" */\n _paq.push(['trackPageView']);\n _paq.push(['enableLinkTracking']);\n (() => {\n const u = `//${matomoUrl}/`;\n _paq.push(['setTrackerUrl', `${u}matomo.php`]);\n _paq.push(['setSiteId', siteId]);\n const d = document;\n const g = d.createElement('script');\n const s = d.getElementsByTagName('script')[0];\n g.async = true;\n g.src = `${u}matomo.js`;\n s.parentNode?.insertBefore(g, s);\n })();\n\n isInitialized = true;\n};\n"],"names":[],"mappings":"AAeA,IAAI,aAAgB,GAAA,KAAA,CAAA;AACP,MAAA,UAAA,GAAa,CAAC,SAAA,EAAmB,MAAmB,KAAA;AAE/D,EAAA,IAAI,aAAe,EAAA,OAAA;AAEnB,EAAA,MAAM,IAAS,GAAA,MAAA,CAAe,IAAQ,GAAA,MAAA,CAAe,QAAQ,EAAC,CAAA;AAE9D,EAAK,IAAA,CAAA,IAAA,CAAK,CAAC,eAAe,CAAC,CAAA,CAAA;AAC3B,EAAK,IAAA,CAAA,IAAA,CAAK,CAAC,oBAAoB,CAAC,CAAA,CAAA;AAChC,EAAA,CAAC,MAAM;AACL,IAAM,MAAA,CAAA,GAAI,KAAK,SAAS,CAAA,CAAA,CAAA,CAAA;AACxB,IAAA,IAAA,CAAK,KAAK,CAAC,eAAA,EAAiB,CAAG,EAAA,CAAC,YAAY,CAAC,CAAA,CAAA;AAC7C,IAAA,IAAA,CAAK,IAAK,CAAA,CAAC,WAAa,EAAA,MAAM,CAAC,CAAA,CAAA;AAC/B,IAAA,MAAM,CAAI,GAAA,QAAA,CAAA;AACV,IAAM,MAAA,CAAA,GAAI,CAAE,CAAA,aAAA,CAAc,QAAQ,CAAA,CAAA;AAClC,IAAA,MAAM,CAAI,GAAA,CAAA,CAAE,oBAAqB,CAAA,QAAQ,EAAE,CAAC,CAAA,CAAA;AAC5C,IAAA,CAAA,CAAE,KAAQ,GAAA,IAAA,CAAA;AACV,IAAE,CAAA,CAAA,GAAA,GAAM,GAAG,CAAC,CAAA,SAAA,CAAA,CAAA;AACZ,IAAE,CAAA,CAAA,UAAA,EAAY,YAAa,CAAA,CAAA,EAAG,CAAC,CAAA,CAAA;AAAA,GAC9B,GAAA,CAAA;AAEH,EAAgB,aAAA,GAAA,IAAA,CAAA;AAClB;;;;"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
2
|
+
import { AnalyticsApi, ConfigApi, AnalyticsEvent } from '@backstage/core-plugin-api';
|
|
3
|
+
import * as _backstage_config from '@backstage/config';
|
|
4
|
+
|
|
5
|
+
/** @public */
|
|
6
|
+
declare const analyticsModuleMatomoPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}, {}>;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
declare class MatomoAnalytics implements AnalyticsApi {
|
|
12
|
+
private readonly configApi;
|
|
13
|
+
private constructor();
|
|
14
|
+
static fromConfig(config: ConfigApi): MatomoAnalytics;
|
|
15
|
+
captureEvent(event: AnalyticsEvent): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Api factory method for matomo
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
declare const MatomoAnalyticsApi: _backstage_core_plugin_api.ApiFactory<AnalyticsApi, MatomoAnalytics, {
|
|
22
|
+
configApi: _backstage_config.Config;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
export { MatomoAnalytics, MatomoAnalyticsApi, analyticsModuleMatomoPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createPlugin } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const analyticsModuleMatomoPlugin = createPlugin({\n id: 'analytics-module-matomo',\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,8BAA8B,YAAa,CAAA;AAAA,EACtD,EAAI,EAAA,yBAAA;AACN,CAAC;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@backstage-community/plugin-analytics-module-matomo",
|
|
3
|
+
"version": "1.9.0",
|
|
4
|
+
"main": "dist/index.esm.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public",
|
|
9
|
+
"main": "dist/index.esm.js",
|
|
10
|
+
"types": "dist/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"backstage": {
|
|
13
|
+
"role": "frontend-plugin-module",
|
|
14
|
+
"pluginId": "app",
|
|
15
|
+
"pluginPackage": "@backstage/plugin-app-backend"
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"scripts": {
|
|
19
|
+
"start": "backstage-cli package start",
|
|
20
|
+
"build": "backstage-cli package build",
|
|
21
|
+
"prettier:check": "prettier --ignore-unknown --check .",
|
|
22
|
+
"prettier:fix": "prettier --ignore-unknown --write .",
|
|
23
|
+
"lint": "backstage-cli package lint",
|
|
24
|
+
"lint:fix": "backstage-cli package lint --fix",
|
|
25
|
+
"test": "backstage-cli package test",
|
|
26
|
+
"clean": "backstage-cli package clean",
|
|
27
|
+
"prepack": "backstage-cli package prepack",
|
|
28
|
+
"postpack": "backstage-cli package postpack"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://backstage.io",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/backstage/community-plugins",
|
|
34
|
+
"directory": "workspaces/analytics/plugins/analytics-module-matomo"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@backstage/core-plugin-api": "^1.10.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@backstage/cli": "0.28.2",
|
|
44
|
+
"@backstage/core-app-api": "1.15.1",
|
|
45
|
+
"@backstage/core-components": "^0.15.1",
|
|
46
|
+
"@backstage/dev-utils": "1.1.2",
|
|
47
|
+
"@redhat-developer/red-hat-developer-hub-theme": "0.4.0",
|
|
48
|
+
"@testing-library/jest-dom": "6.4.8",
|
|
49
|
+
"@types/node": "18.19.33",
|
|
50
|
+
"cross-fetch": "4.0.0",
|
|
51
|
+
"msw": "1.3.3",
|
|
52
|
+
"prettier": "3.3.3"
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"dist",
|
|
56
|
+
"config.d.ts"
|
|
57
|
+
],
|
|
58
|
+
"configSchema": "config.d.ts",
|
|
59
|
+
"maintainers": [
|
|
60
|
+
"@yashoswalyo",
|
|
61
|
+
"@deshmukhmayur",
|
|
62
|
+
"@riginoommen"
|
|
63
|
+
],
|
|
64
|
+
"author": "The Backstage Community",
|
|
65
|
+
"bugs": "https://github.com/backstage/community-plugins/issues",
|
|
66
|
+
"keywords": [
|
|
67
|
+
"support:tech-preview",
|
|
68
|
+
"lifecycle:active"
|
|
69
|
+
],
|
|
70
|
+
"module": "./dist/index.esm.js"
|
|
71
|
+
}
|