ga4-export-fixer 0.1.4-dev.1 → 0.1.4-dev.2

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
@@ -1,6 +1,6 @@
1
1
  # ga4-export-fixer
2
2
 
3
- Helpers and table definitions for processing GA4 (Google Analytics 4) BigQuery export data in **Dataform**.
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
5
  ## Installation
6
6
 
@@ -148,11 +148,12 @@ pre_operations {
148
148
 
149
149
  All fields are optional except `sourceTable`. Default values are applied automatically, so you only need to specify the fields you want to override.
150
150
 
151
- | Field | Type | Default | Description |
151
+ | Field | Type | Default/Required | Description |
152
152
  |-------|------|---------|-------------|
153
153
  | `sourceTable` | Dataform ref() / string | **required** | Source GA4 export table. Use `ref()` in Dataform or a string in format `` `project.dataset.table` `` |
154
154
  | `self` | Dataform self() | **required for .SQLX deployment** | Reference to the table itself. Use `self()` in Dataform |
155
155
  | `incremental` | Dataform incremental() | **required for .SQLX deployment** | Switch between incremental and full refresh logic. Use `incremental()` in Dataform |
156
+ | `dataformTableConfig` | object | **In JS deployment only** | Include your Dataform table configuration object for the JS deployment to override the default values and include new options. See: https://docs.cloud.google.com/dataform/docs/reference/dataform-core-reference#itableconfig |
156
157
  | `schemaLock` | string (YYYYMMDD) | `undefined` | Lock the table schema to a specific date. Must be a valid date >= `"20241009"` |
157
158
  | `timezone` | string | `'Etc/UTC'` | IANA timezone for event datetime (e.g. `'Europe/Helsinki'`) |
158
159
  | `customTimestampParam` | string | `undefined` | Name of a custom event parameter containing a JS timestamp in milliseconds (e.g. collected via `Date.now()`) |
package/constants.js CHANGED
@@ -4,6 +4,8 @@ const constants = {
4
4
  DATE_RANGE_END_VARIABLE: 'date_range_end',
5
5
  DATE_COLUMN: 'event_date',
6
6
  DEFAULT_EVENTS_TABLE_NAME: 'ga4_events_enhanced',
7
+ TABLE_DESCRIPTION_SUFFIX: 'Created by the ga4-export-fixer package.',
8
+ TABLE_DESCRIPTION_DOCUMENTATION_LINK: 'See package documentation at https://github.com/tanelytics/ga4-export-fixer#readme',
7
9
  };
8
10
 
9
11
  module.exports = constants;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ga4-export-fixer",
3
- "version": "0.1.4-dev.1",
3
+ "version": "0.1.4-dev.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -376,11 +376,16 @@ const createEnhancedEventsTable = (dataformPublish, config) => {
376
376
 
377
377
  const tableDescription = `GA4 Events Enhanced
378
378
 
379
- - Combines daily (processed) and intraday exports so the best available version of each event is always used.
380
- - Key fields such as page_location and session_id are promoted to columns for faster queries.
381
- - Supports incremental updates on any schedule.
382
-
383
- Created by the ga4-export-fixer package.`;
379
+ - Combines daily (processed) and intraday exports so the best available version of each event is always used.
380
+ - Incremental updates: All data with "data_is_final" flag set to false is deleted and replaced with the latest available data on every run (supports any schedule: daily, hourly, or custom).
381
+ - Keeps the flexible schema of the original export while promoting key fields (e.g. page_location, session_id) to columns for faster queries.
382
+ - Partitioned by event_date and clustered for optimal query performance.
383
+ - Event parameter handling: promote params to columns or exclude by name.
384
+ - Session-level fields: landing_page, fixed user_id, and configurable session parameters.
385
+ - Other improvements and refinements based on configuration
386
+
387
+ ${constants.TABLE_DESCRIPTION_SUFFIX}
388
+ ${constants.TABLE_DESCRIPTION_DOCUMENTATION_LINK}`;
384
389
 
385
390
  // the defaults for the dataform table config
386
391
  const defaultDataformTableConfig = {