ga4-export-fixer 0.2.1-dev.2 → 0.2.2-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 +6 -6
- package/package.json +2 -2
- package/tables/ga4EventsEnhanced.js +2 -0
package/README.md
CHANGED
|
@@ -42,13 +42,13 @@ npm install ga4-export-fixer
|
|
|
42
42
|
|
|
43
43
|
Include the package in the package.json file in your Dataform repository.
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
**`package.json`**
|
|
46
46
|
|
|
47
47
|
```json
|
|
48
48
|
{
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@dataform/core": "3.0.42",
|
|
51
|
-
"ga4-export-fixer": "0.2.
|
|
51
|
+
"ga4-export-fixer": "0.2.1"
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
```
|
|
@@ -79,7 +79,7 @@ Create a new **ga4_events_enhanced** table using a **.js** file in your reposito
|
|
|
79
79
|
|
|
80
80
|
##### Using Defaults
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
**`definitions/ga4/ga4_events_enhanced.js`**
|
|
83
83
|
|
|
84
84
|
```javascript
|
|
85
85
|
const { ga4EventsEnhanced } = require('ga4-export-fixer');
|
|
@@ -93,7 +93,7 @@ ga4EventsEnhanced.createTable(publish, config);
|
|
|
93
93
|
|
|
94
94
|
##### With Custom Configuration
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
**`definitions/ga4/ga4_events_enhanced.js`**
|
|
97
97
|
|
|
98
98
|
```javascript
|
|
99
99
|
const { ga4EventsEnhanced } = require('ga4-export-fixer');
|
|
@@ -155,7 +155,7 @@ ga4EventsEnhanced.createTable(publish, config);
|
|
|
155
155
|
|
|
156
156
|
Alternatively, you can create the **ga4_events_enhanced** table using a .SQLX file.
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
**`definitions/ga4/ga4_events_enhanced.sqlx`**
|
|
159
159
|
|
|
160
160
|
```javascript
|
|
161
161
|
config {
|
|
@@ -194,7 +194,7 @@ The **incrementalDateFilter()** function applies the same date filtering used by
|
|
|
194
194
|
|
|
195
195
|
Key fields such as session_id, user_id, and session_traffic_source_last_click are available as clean, sessionized versions that handle edge cases like sessions spanning midnight.
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
**`definitions/ga4/ga4_sessions.sqlx`**
|
|
198
198
|
|
|
199
199
|
```javascript
|
|
200
200
|
config {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ga4-export-fixer",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2-dev.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"config.js"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"test": "node tests/ga4EventsEnhanced.test.js",
|
|
18
|
+
"test": "node tests/ga4EventsEnhanced.test.js && node tests/mergeSQLConfigurations.test.js",
|
|
19
19
|
"test:events": "node tests/ga4EventsEnhanced.test.js",
|
|
20
20
|
"test:merge": "node tests/mergeSQLConfigurations.test.js",
|
|
21
21
|
"readme": "node scripts/updateReadme.js",
|
|
@@ -77,6 +77,7 @@ const getFinalColumnOrder = (eventDataStep, sessionDataStep) => {
|
|
|
77
77
|
|
|
78
78
|
const trafficSourceColumns = [
|
|
79
79
|
'collected_traffic_source',
|
|
80
|
+
'session_first_traffic_source',
|
|
80
81
|
'session_traffic_source_last_click',
|
|
81
82
|
'user_traffic_source',
|
|
82
83
|
];
|
|
@@ -238,6 +239,7 @@ ${excludedEventsSQL}`,
|
|
|
238
239
|
merged_user_id: `ifnull(${helpers.aggregateValue('user_id', 'last', mainTimestampColumn)}, any_value(user_pseudo_id))`,
|
|
239
240
|
session_params: helpers.aggregateSessionParams(mergedConfig.sessionParams, 'session_params_prep', mainTimestampColumn),
|
|
240
241
|
session_traffic_source_last_click: helpers.aggregateValue('session_traffic_source_last_click', 'first', mainTimestampColumn),
|
|
242
|
+
session_first_traffic_source: helpers.aggregateValue('collected_traffic_source', 'first', mainTimestampColumn),
|
|
241
243
|
landing_page: helpers.aggregateValue(`if(entrances > 0, page, null)`, 'first', mainTimestampColumn),
|
|
242
244
|
},
|
|
243
245
|
from: 'event_data',
|