ga4-export-fixer 0.2.1 → 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 CHANGED
@@ -42,7 +42,7 @@ npm install ga4-export-fixer
42
42
 
43
43
  Include the package in the package.json file in your Dataform repository.
44
44
 
45
- `**package.json**`
45
+ **`package.json`**
46
46
 
47
47
  ```json
48
48
  {
@@ -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
- `**definitions/ga4/ga4_events_enhanced.js`**
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
- `**definitions/ga4/ga4_events_enhanced.js**`
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
- `**definitions/ga4/ga4_events_enhanced.sqlx`**
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
- `**definitions/ga4/ga4_sessions.sqlx`**
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.1",
3
+ "version": "0.2.2-dev.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -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',