ga4-export-fixer 0.5.2-dev.2 → 0.5.2-dev.3
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/package.json
CHANGED
|
@@ -225,8 +225,11 @@ const _generateEnhancedEventsSQL = (mergedConfig) => {
|
|
|
225
225
|
// ecommerce
|
|
226
226
|
ecommerce: helpers.fixEcommerceStruct('ecommerce'),
|
|
227
227
|
items: 'items',
|
|
228
|
-
// unique row id for item list attribution join
|
|
229
|
-
|
|
228
|
+
// unique row id for item list attribution join.
|
|
229
|
+
// row_number() over() breaks hash collisions for batched events with identical data.
|
|
230
|
+
// Non-determinism is safe: colliding rows have identical items (to_json_string(items) is in the hash),
|
|
231
|
+
// so swapping row numbers between them produces the same final result.
|
|
232
|
+
_event_row_id: itemListAttribution ? `farm_fingerprint(concat(user_pseudo_id, cast(event_timestamp as string), event_name, to_json_string(items), cast(row_number() over() as string)))` : undefined,
|
|
230
233
|
// flag if the data is "final" and is not expected to change anymore
|
|
231
234
|
data_is_final: helpers.isFinalData(mergedConfig.dataIsFinal.detectionMethod, mergedConfig.dataIsFinal.dayThreshold),
|
|
232
235
|
export_type: helpers.getGa4ExportType('_table_suffix'),
|