ga4-export-fixer 0.6.2-dev.0 → 0.6.2-dev.1

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
@@ -453,23 +453,23 @@ The package includes built-in data quality assertions that can be automatically
453
453
  ga4EventsEnhanced.createTable(publish, config, { assert });
454
454
  ```
455
455
 
456
- This creates the table and the following assertions using the same configuration:
456
+ This creates the table along with the default-enabled assertions, using the same configuration:
457
457
 
458
- | Assertion | Name | Description |
459
- | --------- | ---- | ----------- |
460
- | `dailyQuality` | `{tableName}_daily_quality` | Compares session count, event count, and item revenue per day between the enhanced table and raw export. Detects missing days, count mismatches, and non-final data inflation |
461
- | `itemRevenue` | `{tableName}_item_revenue` | Reconciles item_revenue at the (event_date, item_id) grain between the enhanced table and raw export |
458
+ | Assertion | Name | Enabled by default | Description |
459
+ | --------- | ---- | ------------------ | ----------- |
460
+ | `dailyQuality` | `{tableName}_daily_quality` | Yes | Compares session count, event count, and item revenue per day between the enhanced table and raw export. Detects missing days, count mismatches, and non-final data inflation |
461
+ | `itemRevenue` | `{tableName}_item_revenue` | No (opt-in) | Reconciles item_revenue at the (event_date, item_id) grain between the enhanced table and raw export |
462
462
 
463
463
  Assertions inherit the table's schema and tags from `dataformTableConfig`. Each assertion queries the last 5 days of data.
464
464
 
465
465
  #### Selective Assertions
466
466
 
467
- Disable individual assertions by setting them to `false`:
467
+ Enable opt-in assertions by setting them to `true`, or disable default-enabled ones by setting them to `false`:
468
468
 
469
469
  ```javascript
470
470
  ga4EventsEnhanced.createTable(publish, config, {
471
471
  assert,
472
- assertions: { dailyQuality: true, itemRevenue: false },
472
+ assertions: { dailyQuality: true, itemRevenue: true },
473
473
  });
474
474
  ```
475
475
 
package/createTable.js CHANGED
@@ -67,6 +67,7 @@ const createTable = (dataformPublish, userConfig, tableModule, options) => {
67
67
  for (const [key, assertionDef] of Object.entries(tableModule.assertions)) {
68
68
  const assertionOption = options.assertions?.[key];
69
69
  if (assertionOption === false) continue;
70
+ if (assertionOption === undefined && assertionDef.enabledByDefault === false) continue;
70
71
 
71
72
  const assertionName = `${tableName}_${assertionDef.defaultName}`;
72
73
  const assertionDataformConfig = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ga4-export-fixer",
3
- "version": "0.6.2-dev.0",
3
+ "version": "0.6.2-dev.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -6,6 +6,6 @@ module.exports = {
6
6
  dailyQuality: generateDailyQualityAssertionSql,
7
7
  _internal: {
8
8
  dailyQuality: { generate: _generateDailyQualityAssertionSql, defaultName: 'daily_quality' },
9
- itemRevenue: { generate: _generateItemRevenueAssertionSql, defaultName: 'item_revenue' },
9
+ itemRevenue: { generate: _generateItemRevenueAssertionSql, defaultName: 'item_revenue', enabledByDefault: false },
10
10
  },
11
11
  };