ga4-export-fixer 0.2.2 → 0.2.3-dev.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/README.md +4 -0
- package/helpers.js +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -162,6 +162,7 @@ config {
|
|
|
162
162
|
type: "incremental",
|
|
163
163
|
description: "GA4 Events Enhanced table",
|
|
164
164
|
schema: "ga4",
|
|
165
|
+
onSchemaChange: "EXTEND",
|
|
165
166
|
bigquery: {
|
|
166
167
|
partitionBy: "event_date",
|
|
167
168
|
clusterBy: ['event_name', 'session_id', 'page_location', 'data_is_final'],
|
|
@@ -299,12 +300,15 @@ All fields are optional except `sourceTable`. Default values are applied automat
|
|
|
299
300
|
"ga4_export_fixer": "true"
|
|
300
301
|
}
|
|
301
302
|
},
|
|
303
|
+
"onSchemaChange": "EXTEND",
|
|
302
304
|
"tags": [
|
|
303
305
|
"ga4_export_fixer"
|
|
304
306
|
]
|
|
305
307
|
}
|
|
306
308
|
```
|
|
307
309
|
|
|
310
|
+
The `onSchemaChange: "EXTEND"` setting updates the result table schema on incremental runs, adding columns for any new fields the query produces.
|
|
311
|
+
|
|
308
312
|
</details>
|
|
309
313
|
<br>
|
|
310
314
|
|
package/helpers.js
CHANGED
|
@@ -33,13 +33,18 @@ const unnestParam = (keyName, paramsArray, dataType) => {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
// event_params
|
|
36
|
+
// event_params and session_params
|
|
37
37
|
|
|
38
38
|
// unnest a param from the event_params array
|
|
39
39
|
const unnestEventParam = (keyName, dataType) => {
|
|
40
40
|
return unnestParam(keyName, 'event_params', dataType);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
// unnest a param from the session_params array
|
|
44
|
+
const unnestSessionParam = (keyName, dataType) => {
|
|
45
|
+
return unnestParam(keyName, 'session_params', dataType);
|
|
46
|
+
};
|
|
47
|
+
|
|
43
48
|
/*
|
|
44
49
|
Common identifiers
|
|
45
50
|
*/
|
|
@@ -763,6 +768,7 @@ module.exports = {
|
|
|
763
768
|
getEventDateTime,
|
|
764
769
|
getEventTimestampMicros,
|
|
765
770
|
unnestEventParam,
|
|
771
|
+
unnestSessionParam,
|
|
766
772
|
sessionId,
|
|
767
773
|
aggregateValue,
|
|
768
774
|
aggregateValues,
|