ga4-export-fixer 0.1.4 → 0.1.5-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 +15 -1
- package/package.json +2 -2
- package/tables/ga4EventsEnhanced.js +4 -2
- package/utils.js +3 -3
package/README.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
**ga4-export-fixer** is a **Dataform NPM package** that transforms raw GA4 BigQuery export data into a cleaner, more queryable incremental table. It combines daily and intraday exports so the best available version of each event is always in use, adds session-level fields like `session_id` and `landing_page`, promotes key event parameters to columns, and fixes known GA4 export issues — handling the boilerplate transformations that are otherwise tedious to include in every GA4 query.
|
|
4
4
|
|
|
5
|
+
The goal of the package is to **speed up development** when building data models and pipelines on top of GA4 export data, allowing you to focus on your use case instead of wrestling with the raw export format.
|
|
6
|
+
|
|
7
|
+
### Planned Features
|
|
8
|
+
|
|
9
|
+
- Support for using only intraday export data
|
|
10
|
+
- Tools for building on top of the enhanced events table
|
|
11
|
+
- Column descriptions
|
|
12
|
+
- Default configurations for app and web properties
|
|
13
|
+
- Item list attribution
|
|
14
|
+
- Data enrichment (item-level, session-level, event-level)
|
|
15
|
+
- Support for fresh export (GA4 360)
|
|
16
|
+
- Custom processing steps (additional CTEs)
|
|
17
|
+
- Custom traffic source attribution
|
|
18
|
+
|
|
5
19
|
## Installation
|
|
6
20
|
|
|
7
21
|
### Bash
|
|
@@ -19,7 +33,7 @@ Include the package in the package.json file in your Dataform repository.
|
|
|
19
33
|
{
|
|
20
34
|
"dependencies": {
|
|
21
35
|
"@dataform/core": "3.0.42",
|
|
22
|
-
"ga4-export-fixer": "0.1.
|
|
36
|
+
"ga4-export-fixer": "0.1.5-dev.0"
|
|
23
37
|
}
|
|
24
38
|
}
|
|
25
39
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ga4-export-fixer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5-dev.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/tanelytics/ga4-export-fixer"
|
|
21
|
+
"url": "git+https://github.com/tanelytics/ga4-export-fixer.git"
|
|
22
22
|
},
|
|
23
23
|
"author": "Taneli Salonen",
|
|
24
24
|
"license": "MIT",
|
|
@@ -52,11 +52,13 @@ const defaultConfig = {
|
|
|
52
52
|
//{name: 'page_location', type: 'string', columnName: 'page_location2'},
|
|
53
53
|
],
|
|
54
54
|
sessionParams: [],
|
|
55
|
-
defaultExcludedEvents: [
|
|
55
|
+
defaultExcludedEvents: [],
|
|
56
|
+
// session_start and first_visit are excluded via the excludedEvents array
|
|
57
|
+
// this allows the user to include them if needed
|
|
58
|
+
excludedEvents: [
|
|
56
59
|
'session_start',
|
|
57
60
|
'first_visit'
|
|
58
61
|
],
|
|
59
|
-
excludedEvents: [],
|
|
60
62
|
defaultExcludedColumns: [
|
|
61
63
|
'event_dimensions', // legacy column, not needed
|
|
62
64
|
'traffic_source', // renamed to user_traffic_source
|
package/utils.js
CHANGED
|
@@ -87,7 +87,7 @@ ${groupByClause}`;
|
|
|
87
87
|
*
|
|
88
88
|
* Rules:
|
|
89
89
|
* - Nested objects are merged recursively key by key
|
|
90
|
-
* - Arrays are
|
|
90
|
+
* - Arrays are overwritten by user input
|
|
91
91
|
* - Default values are preserved unless explicitly overridden (including with undefined)
|
|
92
92
|
* - Explicitly setting a value to undefined in inputConfig will override the default
|
|
93
93
|
* - Date fields: after merging, specific date fields (listed in dateFields) are processed via processDate().
|
|
@@ -120,9 +120,9 @@ const mergeSQLConfigurations = (defaultConfig, inputConfig = {}) => {
|
|
|
120
120
|
continue;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
// Handle arrays:
|
|
123
|
+
// Handle arrays: overwrite with user input
|
|
124
124
|
if (Array.isArray(defaultValue) && Array.isArray(inputValue)) {
|
|
125
|
-
result[key] =
|
|
125
|
+
result[key] = inputValue;
|
|
126
126
|
continue;
|
|
127
127
|
}
|
|
128
128
|
|