@backstage-community/plugin-analytics-module-ga4 0.20.0 → 0.22.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 +12 -0
- package/config.schema.json +117 -0
- package/package.json +9 -9
- package/config.d.ts +0 -112
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @backstage-community/plugin-analytics-module-ga4
|
|
2
2
|
|
|
3
|
+
## 0.22.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 70ce2a9: Backstage version bump to v1.54.5
|
|
8
|
+
|
|
9
|
+
## 0.21.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- bb6da15: Backstage version bump to v1.52.0
|
|
14
|
+
|
|
3
15
|
## 0.20.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"app": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"analytics": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"ga4": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"measurementId": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Google Analytics measurement ID, e.g. G-000000-0",
|
|
17
|
+
"visibility": "frontend"
|
|
18
|
+
},
|
|
19
|
+
"identity": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": [
|
|
22
|
+
"disabled",
|
|
23
|
+
"optional",
|
|
24
|
+
"required"
|
|
25
|
+
],
|
|
26
|
+
"description": "Controls how the identityApi is used when sending data to GA:\n\n- `disabled`: (Default) Explicitly prevents a user's identity from being used when capturing events in GA.\n- `optional`: Pageviews and hits are forwarded to GA as they happen and only include user identity metadata once known. Guarantees that hits are captured for all sessions, even if no sign in occurs, but may result in dropped hits in User ID views.\n- `required`: All pageviews and hits are deferred until an identity is known. Guarantees that all data sent to GA correlates to a user identity, but prevents GA from receiving events for sessions in which a user does not sign in. An `identityApi` instance must be passed during instantiation when set to this value.",
|
|
27
|
+
"visibility": "frontend"
|
|
28
|
+
},
|
|
29
|
+
"debug": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"description": "Whether to log analytics debug statements to the console. Defaults to false.",
|
|
32
|
+
"visibility": "frontend"
|
|
33
|
+
},
|
|
34
|
+
"cookieFlags": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Google Analytics cookie flags. Defaults to 'SameSite=Lax' More information https://developers.google.com/analytics/devguides/collection/ga4/reference/config#cookie_flags",
|
|
37
|
+
"visibility": "frontend"
|
|
38
|
+
},
|
|
39
|
+
"enableSendPageView": {
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"description": "Whether to send default send_page_view event. Defaults to false.",
|
|
42
|
+
"visibility": "frontend"
|
|
43
|
+
},
|
|
44
|
+
"testMode": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"description": "Prevents events from actually being sent when set to true. Defaults to false.",
|
|
47
|
+
"visibility": "frontend"
|
|
48
|
+
},
|
|
49
|
+
"contentGrouping": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"enum": [
|
|
52
|
+
"pluginId",
|
|
53
|
+
"extension",
|
|
54
|
+
"routeRef"
|
|
55
|
+
],
|
|
56
|
+
"description": "Content grouping definition Feature available in Google Analytics 4 More information https://support.google.com/analytics/answer/11523339?hl=en Data can be grouped by pluginId, routeRef Takes 24 hours before metrics shows up in GA dashboard Specifies the dimension to be used for content grouping Can be one of pluginId, extension or routeRef",
|
|
57
|
+
"visibility": "frontend"
|
|
58
|
+
},
|
|
59
|
+
"allowedContexts": {
|
|
60
|
+
"anyOf": [
|
|
61
|
+
{
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": {
|
|
64
|
+
"type": "string"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"const": "*"
|
|
72
|
+
},
|
|
73
|
+
"minItems": 1,
|
|
74
|
+
"maxItems": 1
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"description": "Configuration informing how Analytics Context and Event Attributes metadata will be captured in Google Analytics. Contexts that will be sent as parameters in the event. context-name will be prefixed by c_, for example, pluginId will be c_pluginId in the event.",
|
|
78
|
+
"visibility": "frontend"
|
|
79
|
+
},
|
|
80
|
+
"allowedAttributes": {
|
|
81
|
+
"anyOf": [
|
|
82
|
+
{
|
|
83
|
+
"type": "array",
|
|
84
|
+
"items": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"type": "array",
|
|
90
|
+
"items": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"const": "*"
|
|
93
|
+
},
|
|
94
|
+
"minItems": 1,
|
|
95
|
+
"maxItems": 1
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"description": "Attributes that will be sent as parameters in the event attribute-name will be prefixed by a_, for example , testAttribute will be c_testAttribute in the event.",
|
|
99
|
+
"visibility": "frontend"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": [
|
|
103
|
+
"measurementId"
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"required": [
|
|
108
|
+
"ga4"
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"required": [
|
|
115
|
+
"app"
|
|
116
|
+
]
|
|
117
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-analytics-module-ga4",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin-module",
|
|
6
6
|
"pluginId": "app",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"types": "./dist/index.d.ts",
|
|
49
49
|
"files": [
|
|
50
50
|
"dist",
|
|
51
|
-
"config.
|
|
51
|
+
"config.schema.json"
|
|
52
52
|
],
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "backstage-cli package build",
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@backstage/config": "^1.3.8",
|
|
64
|
-
"@backstage/core-components": "^0.18.
|
|
65
|
-
"@backstage/core-plugin-api": "^1.12.
|
|
66
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
67
|
-
"@backstage/plugin-app-react": "^0.2.
|
|
64
|
+
"@backstage/core-components": "^0.18.13",
|
|
65
|
+
"@backstage/core-plugin-api": "^1.12.9",
|
|
66
|
+
"@backstage/frontend-plugin-api": "^0.18.0",
|
|
67
|
+
"@backstage/plugin-app-react": "^0.2.6",
|
|
68
68
|
"react-ga4": "^2.0.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@backstage/cli": "^0.36.
|
|
72
|
-
"@backstage/dev-utils": "^1.1.
|
|
71
|
+
"@backstage/cli": "^0.36.5",
|
|
72
|
+
"@backstage/dev-utils": "^1.1.26",
|
|
73
73
|
"@testing-library/dom": "^10.0.0",
|
|
74
74
|
"@testing-library/jest-dom": "^6.0.0",
|
|
75
75
|
"@testing-library/react": "^16.0.0",
|
|
@@ -85,6 +85,6 @@
|
|
|
85
85
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
86
86
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
87
87
|
},
|
|
88
|
-
"configSchema": "config.
|
|
88
|
+
"configSchema": "config.schema.json",
|
|
89
89
|
"module": "./dist/index.esm.js"
|
|
90
90
|
}
|
package/config.d.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2020 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
|
-
|
|
17
|
-
export interface Config {
|
|
18
|
-
app: {
|
|
19
|
-
// TODO: Only marked as optional because backstage-cli config:check in the
|
|
20
|
-
// context of the monorepo is too strict. Ideally, this would be marked as
|
|
21
|
-
// required.
|
|
22
|
-
analytics?: {
|
|
23
|
-
ga4: {
|
|
24
|
-
/**
|
|
25
|
-
* Google Analytics measurement ID, e.g. G-000000-0
|
|
26
|
-
* @visibility frontend
|
|
27
|
-
*/
|
|
28
|
-
measurementId: string;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Controls how the identityApi is used when sending data to GA:
|
|
32
|
-
*
|
|
33
|
-
* - `disabled`: (Default) Explicitly prevents a user's identity from
|
|
34
|
-
* being used when capturing events in GA.
|
|
35
|
-
* - `optional`: Pageviews and hits are forwarded to GA as they happen
|
|
36
|
-
* and only include user identity metadata once known. Guarantees
|
|
37
|
-
* that hits are captured for all sessions, even if no sign in
|
|
38
|
-
* occurs, but may result in dropped hits in User ID views.
|
|
39
|
-
* - `required`: All pageviews and hits are deferred until an identity
|
|
40
|
-
* is known. Guarantees that all data sent to GA correlates to a user
|
|
41
|
-
* identity, but prevents GA from receiving events for sessions in
|
|
42
|
-
* which a user does not sign in. An `identityApi` instance must be
|
|
43
|
-
* passed during instantiation when set to this value.
|
|
44
|
-
*
|
|
45
|
-
* @visibility frontend
|
|
46
|
-
*/
|
|
47
|
-
identity?: 'disabled' | 'optional' | 'required';
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Whether to log analytics debug statements to the console.
|
|
51
|
-
* Defaults to false.
|
|
52
|
-
*
|
|
53
|
-
* @visibility frontend
|
|
54
|
-
*/
|
|
55
|
-
debug?: boolean;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Google Analytics cookie flags. Defaults to 'SameSite=Lax'
|
|
59
|
-
* More information https://developers.google.com/analytics/devguides/collection/ga4/reference/config#cookie_flags
|
|
60
|
-
*
|
|
61
|
-
* @visibility frontend
|
|
62
|
-
*/
|
|
63
|
-
cookieFlags?: string;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Whether to send default send_page_view event.
|
|
67
|
-
* Defaults to false.
|
|
68
|
-
*
|
|
69
|
-
* @visibility frontend
|
|
70
|
-
*/
|
|
71
|
-
enableSendPageView?: boolean;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Prevents events from actually being sent when set to true. Defaults
|
|
75
|
-
* to false.
|
|
76
|
-
*
|
|
77
|
-
* @visibility frontend
|
|
78
|
-
*/
|
|
79
|
-
testMode?: boolean;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Content grouping definition
|
|
83
|
-
* Feature available in Google Analytics 4
|
|
84
|
-
* More information https://support.google.com/analytics/answer/11523339?hl=en
|
|
85
|
-
* Data can be grouped by pluginId, routeRef
|
|
86
|
-
* Takes 24 hours before metrics shows up in GA dashboard
|
|
87
|
-
* Specifies the dimension to be used for content grouping
|
|
88
|
-
* Can be one of pluginId, extension or routeRef
|
|
89
|
-
* @visibility frontend
|
|
90
|
-
*
|
|
91
|
-
*/
|
|
92
|
-
contentGrouping?: 'pluginId' | 'extension' | 'routeRef';
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Configuration informing how Analytics Context and Event Attributes
|
|
96
|
-
* metadata will be captured in Google Analytics.
|
|
97
|
-
* Contexts that will be sent as parameters in the event.
|
|
98
|
-
* context-name will be prefixed by c_, for example, pluginId will be c_pluginId in the event.
|
|
99
|
-
* @visibility frontend
|
|
100
|
-
*/
|
|
101
|
-
allowedContexts?: string[] | ['*'];
|
|
102
|
-
/**
|
|
103
|
-
*
|
|
104
|
-
* Attributes that will be sent as parameters in the event
|
|
105
|
-
* attribute-name will be prefixed by a_, for example , testAttribute will be c_testAttribute in the event.
|
|
106
|
-
* @visibility frontend
|
|
107
|
-
*/
|
|
108
|
-
allowedAttributes?: string[] | ['*'];
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
}
|