From 13bb077e69e216e253189422788f64451e5d2fba Mon Sep 17 00:00:00 2001 From: GitHub actions Date: Thu, 21 Nov 2024 06:26:52 +0000 Subject: [PATCH 1/8] chore(@rudderstack/analytics-js): release version 3.11.2 --- packages/analytics-js/CHANGELOG.md | 5 +++++ packages/analytics-js/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/analytics-js/CHANGELOG.md b/packages/analytics-js/CHANGELOG.md index 5d8632bcc..7e56c08fc 100644 --- a/packages/analytics-js/CHANGELOG.md +++ b/packages/analytics-js/CHANGELOG.md @@ -2,6 +2,11 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). +## [3.11.2](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.11.1...@rudderstack/analytics-js@3.11.2) (2024-11-21) + +### Dependency Updates + +* `@rudderstack/analytics-js-plugins` updated to version `3.6.4` ## [3.11.1](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.11.0...@rudderstack/analytics-js@3.11.1) (2024-11-19) ### Dependency Updates diff --git a/packages/analytics-js/package.json b/packages/analytics-js/package.json index b9700d2e8..9ca4bdcdd 100644 --- a/packages/analytics-js/package.json +++ b/packages/analytics-js/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js", - "version": "3.11.1", + "version": "3.11.2", "description": "RudderStack JavaScript SDK", "main": "dist/npm/modern/cjs/index.cjs", "module": "dist/npm/modern/esm/index.mjs", From 23f99e25ec75ac45c653d70e4907d849702b2299 Mon Sep 17 00:00:00 2001 From: GitHub actions Date: Thu, 21 Nov 2024 06:26:53 +0000 Subject: [PATCH 2/8] chore(@rudderstack/analytics-js-plugins): release version 3.6.5 --- packages/analytics-js-plugins/CHANGELOG.md | 11 +++++++++++ packages/analytics-js-plugins/package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/analytics-js-plugins/CHANGELOG.md b/packages/analytics-js-plugins/CHANGELOG.md index cce6e3d68..08ee6267e 100644 --- a/packages/analytics-js-plugins/CHANGELOG.md +++ b/packages/analytics-js-plugins/CHANGELOG.md @@ -2,6 +2,17 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). +## [3.6.5](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-plugins@3.6.4...@rudderstack/analytics-js-plugins@3.6.5) (2024-11-21) + +### Dependency Updates + +* `@rudderstack/analytics-js` updated to version `3.11.2` +* `@rudderstack/analytics-js-cookies` updated to version `0.4.4` + +### Bug Fixes + +* exclude auth token ([15dc64c](https://github.com/rudderlabs/rudder-sdk-js/commit/15dc64ccfbac66fa33046abd88cb72c9b0ccb147)) + ## [3.6.4](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-plugins@3.6.3...@rudderstack/analytics-js-plugins@3.6.4) (2024-11-19) ### Dependency Updates diff --git a/packages/analytics-js-plugins/package.json b/packages/analytics-js-plugins/package.json index 798fd3034..5af795373 100644 --- a/packages/analytics-js-plugins/package.json +++ b/packages/analytics-js-plugins/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js-plugins", - "version": "3.6.4", + "version": "3.6.5", "private": true, "description": "RudderStack JavaScript SDK plugins", "main": "dist/npm/modern/cjs/index.cjs", From c85e1845fcef6c5a796fec5f34fbd4eed3dc5c21 Mon Sep 17 00:00:00 2001 From: GitHub actions Date: Thu, 21 Nov 2024 06:26:54 +0000 Subject: [PATCH 3/8] chore(@rudderstack/analytics-js-sanity-suite): release version 3.1.36 --- packages/sanity-suite/CHANGELOG.md | 5 +++++ packages/sanity-suite/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/sanity-suite/CHANGELOG.md b/packages/sanity-suite/CHANGELOG.md index d3df415d8..98f94a5d5 100644 --- a/packages/sanity-suite/CHANGELOG.md +++ b/packages/sanity-suite/CHANGELOG.md @@ -2,6 +2,11 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). +## [3.1.36](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-sanity-suite@3.1.35...@rudderstack/analytics-js-sanity-suite@3.1.36) (2024-11-21) + +### Dependency Updates + +* `@rudderstack/analytics-js` updated to version `3.11.2` ## [3.1.35](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-sanity-suite@3.1.34...@rudderstack/analytics-js-sanity-suite@3.1.35) (2024-11-19) ### Dependency Updates diff --git a/packages/sanity-suite/package.json b/packages/sanity-suite/package.json index 4b9be8333..9dc47babd 100644 --- a/packages/sanity-suite/package.json +++ b/packages/sanity-suite/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js-sanity-suite", - "version": "3.1.35", + "version": "3.1.36", "private": true, "description": "Sanity suite for testing JS SDK package", "main": "./dist/v3/cdn/testBook.js", From 292d7fa087a2d50bdecb82aac2bde06937035edd Mon Sep 17 00:00:00 2001 From: GitHub actions Date: Thu, 21 Nov 2024 06:26:55 +0000 Subject: [PATCH 4/8] chore(@rudderstack/analytics-js-integrations): release version 3.11.0 --- packages/analytics-js-integrations/CHANGELOG.md | 14 ++++++++++++++ packages/analytics-js-integrations/package.json | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/analytics-js-integrations/CHANGELOG.md b/packages/analytics-js-integrations/CHANGELOG.md index f0b543187..966ab4d6f 100644 --- a/packages/analytics-js-integrations/CHANGELOG.md +++ b/packages/analytics-js-integrations/CHANGELOG.md @@ -2,6 +2,20 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). +## [3.11.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-integrations@3.10.6...@rudderstack/analytics-js-integrations@3.11.0) (2024-11-21) + + +### Features + +* snap extra parametrs pass ([#1921](https://github.com/rudderlabs/rudder-sdk-js/issues/1921)) ([0998d08](https://github.com/rudderlabs/rudder-sdk-js/commit/0998d081da3cfaaf0e999335384969ab77565230)) + + +### Bug Fixes + +* adroll bugsnag issue ([#1929](https://github.com/rudderlabs/rudder-sdk-js/issues/1929)) ([18589f2](https://github.com/rudderlabs/rudder-sdk-js/commit/18589f2367038cc8c144d07f7dc38abbf10c5a08)) +* ga4 allow zero ([#1915](https://github.com/rudderlabs/rudder-sdk-js/issues/1915)) ([9ebbab9](https://github.com/rudderlabs/rudder-sdk-js/commit/9ebbab92cfdaf12067138e065d726da312c507a5)) +* googleAds bugsnag issue ([#1930](https://github.com/rudderlabs/rudder-sdk-js/issues/1930)) ([4c8a652](https://github.com/rudderlabs/rudder-sdk-js/commit/4c8a652276882ab3dd982976763bff8c58e5db3d)) + ## [3.10.6](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-integrations@3.10.5...@rudderstack/analytics-js-integrations@3.10.6) (2024-11-19) ### Dependency Updates diff --git a/packages/analytics-js-integrations/package.json b/packages/analytics-js-integrations/package.json index 81f452f06..4ec47c094 100644 --- a/packages/analytics-js-integrations/package.json +++ b/packages/analytics-js-integrations/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js-integrations", - "version": "3.10.6", + "version": "3.11.0", "private": true, "description": "RudderStack JavaScript SDK device mode integrations", "main": "dist/npm/modern/cjs/index.js", From b0e051843384d2c97ed29b72987db235dabbee7e Mon Sep 17 00:00:00 2001 From: GitHub actions Date: Thu, 21 Nov 2024 06:26:56 +0000 Subject: [PATCH 5/8] chore(@rudderstack/analytics-js-loading-scripts): release version 3.0.45 --- packages/loading-scripts/CHANGELOG.md | 5 +++++ packages/loading-scripts/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/loading-scripts/CHANGELOG.md b/packages/loading-scripts/CHANGELOG.md index 4c77d9008..cacdc63be 100644 --- a/packages/loading-scripts/CHANGELOG.md +++ b/packages/loading-scripts/CHANGELOG.md @@ -2,6 +2,11 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver). +## [3.0.45](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-loading-scripts@3.0.44...@rudderstack/analytics-js-loading-scripts@3.0.45) (2024-11-21) + +### Dependency Updates + +* `@rudderstack/analytics-js` updated to version `3.11.2` ## [3.0.44](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-loading-scripts@3.0.43...@rudderstack/analytics-js-loading-scripts@3.0.44) (2024-11-19) ### Dependency Updates diff --git a/packages/loading-scripts/package.json b/packages/loading-scripts/package.json index a0abb1958..d5441303c 100644 --- a/packages/loading-scripts/package.json +++ b/packages/loading-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js-loading-scripts", - "version": "3.0.44", + "version": "3.0.45", "private": true, "description": "Loading script for RudderStack JavaScript SDK", "main": "./src/index.js", From 0e83df9f6e3b70bc3962cc9501759d5da240b7c2 Mon Sep 17 00:00:00 2001 From: GitHub actions Date: Thu, 21 Nov 2024 06:27:07 +0000 Subject: [PATCH 6/8] chore(monorepo): sync versions and generate release logs --- package-lock.json | 14 +++++++------- package.json | 2 +- .../analytics-js-integrations/CHANGELOG_LATEST.md | 15 ++++++++++++--- packages/analytics-js-integrations/project.json | 6 +++--- packages/analytics-js-plugins/CHANGELOG_LATEST.md | 12 ++++++++---- packages/analytics-js-plugins/project.json | 6 +++--- packages/analytics-js/CHANGELOG_LATEST.md | 4 +--- packages/analytics-js/project.json | 6 +++--- packages/loading-scripts/CHANGELOG_LATEST.md | 4 ++-- packages/loading-scripts/project.json | 6 +++--- sonar-project.properties | 2 +- 11 files changed, 44 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c7d78e4b..2dab1eb9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rudderstack/analytics-js-monorepo", - "version": "3.53.0", + "version": "3.54.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rudderstack/analytics-js-monorepo", - "version": "3.53.0", + "version": "3.54.0", "hasInstallScript": true, "license": "Elastic-2.0", "workspaces": [ @@ -25284,7 +25284,7 @@ }, "packages/analytics-js": { "name": "@rudderstack/analytics-js", - "version": "3.11.1", + "version": "3.11.2", "license": "Elastic-2.0", "dependencies": { "@preact/signals-core": "1.8.0", @@ -25324,7 +25324,7 @@ }, "packages/analytics-js-integrations": { "name": "@rudderstack/analytics-js-integrations", - "version": "3.10.6", + "version": "3.11.0", "license": "Elastic-2.0", "dependencies": { "@lukeed/uuid": "2.0.1", @@ -25344,7 +25344,7 @@ }, "packages/analytics-js-plugins": { "name": "@rudderstack/analytics-js-plugins", - "version": "3.6.4", + "version": "3.6.5", "license": "Elastic-2.0", "dependencies": { "@rudderstack/analytics-js-common": "*", @@ -25388,7 +25388,7 @@ }, "packages/loading-scripts": { "name": "@rudderstack/analytics-js-loading-scripts", - "version": "3.0.44", + "version": "3.0.45", "license": "Elastic-2.0", "dependencies": { "@rudderstack/analytics-js": "*" @@ -25397,7 +25397,7 @@ }, "packages/sanity-suite": { "name": "@rudderstack/analytics-js-sanity-suite", - "version": "3.1.35", + "version": "3.1.36", "license": "Elastic-2.0", "dependencies": { "@rudderstack/analytics-js": "*", diff --git a/package.json b/package.json index 4585ff9d1..777381e3e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/analytics-js-monorepo", - "version": "3.53.0", + "version": "3.54.0", "private": true, "description": "Monorepo for RudderStack Analytics JS SDK", "workspaces": [ diff --git a/packages/analytics-js-integrations/CHANGELOG_LATEST.md b/packages/analytics-js-integrations/CHANGELOG_LATEST.md index 320d397bc..c6906751f 100644 --- a/packages/analytics-js-integrations/CHANGELOG_LATEST.md +++ b/packages/analytics-js-integrations/CHANGELOG_LATEST.md @@ -1,5 +1,14 @@ -## [3.10.6](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-integrations@3.10.5...@rudderstack/analytics-js-integrations@3.10.6) (2024-11-19) +## [3.11.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-integrations@3.10.6...@rudderstack/analytics-js-integrations@3.11.0) (2024-11-21) -### Dependency Updates -* `@rudderstack/analytics-js-common` updated to version `3.14.1` +### Features + +* snap extra parametrs pass ([#1921](https://github.com/rudderlabs/rudder-sdk-js/issues/1921)) ([0998d08](https://github.com/rudderlabs/rudder-sdk-js/commit/0998d081da3cfaaf0e999335384969ab77565230)) + + +### Bug Fixes + +* adroll bugsnag issue ([#1929](https://github.com/rudderlabs/rudder-sdk-js/issues/1929)) ([18589f2](https://github.com/rudderlabs/rudder-sdk-js/commit/18589f2367038cc8c144d07f7dc38abbf10c5a08)) +* ga4 allow zero ([#1915](https://github.com/rudderlabs/rudder-sdk-js/issues/1915)) ([9ebbab9](https://github.com/rudderlabs/rudder-sdk-js/commit/9ebbab92cfdaf12067138e065d726da312c507a5)) +* googleAds bugsnag issue ([#1930](https://github.com/rudderlabs/rudder-sdk-js/issues/1930)) ([4c8a652](https://github.com/rudderlabs/rudder-sdk-js/commit/4c8a652276882ab3dd982976763bff8c58e5db3d)) + diff --git a/packages/analytics-js-integrations/project.json b/packages/analytics-js-integrations/project.json index 1151c7490..ee4fffe81 100644 --- a/packages/analytics-js-integrations/project.json +++ b/packages/analytics-js-integrations/project.json @@ -51,9 +51,9 @@ "github": { "executor": "@jscutlery/semver:github", "options": { - "tag": "@rudderstack/analytics-js-integrations@3.10.6", - "title": "@rudderstack/analytics-js-integrations@3.10.6", - "discussion-category": "@rudderstack/analytics-js-integrations@3.10.6", + "tag": "@rudderstack/analytics-js-integrations@3.11.0", + "title": "@rudderstack/analytics-js-integrations@3.11.0", + "discussion-category": "@rudderstack/analytics-js-integrations@3.11.0", "notesFile": "./packages/analytics-js-integrations/CHANGELOG_LATEST.md" } } diff --git a/packages/analytics-js-plugins/CHANGELOG_LATEST.md b/packages/analytics-js-plugins/CHANGELOG_LATEST.md index c60790c88..fe814ac91 100644 --- a/packages/analytics-js-plugins/CHANGELOG_LATEST.md +++ b/packages/analytics-js-plugins/CHANGELOG_LATEST.md @@ -1,7 +1,11 @@ -## [3.6.4](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-plugins@3.6.3...@rudderstack/analytics-js-plugins@3.6.4) (2024-11-19) +## [3.6.5](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-plugins@3.6.4...@rudderstack/analytics-js-plugins@3.6.5) (2024-11-21) ### Dependency Updates -* `@rudderstack/analytics-js-common` updated to version `3.14.1` -* `@rudderstack/analytics-js` updated to version `3.11.0` -* `@rudderstack/analytics-js-cookies` updated to version `0.4.3` +* `@rudderstack/analytics-js` updated to version `3.11.2` +* `@rudderstack/analytics-js-cookies` updated to version `0.4.4` + +### Bug Fixes + +* exclude auth token ([15dc64c](https://github.com/rudderlabs/rudder-sdk-js/commit/15dc64ccfbac66fa33046abd88cb72c9b0ccb147)) + diff --git a/packages/analytics-js-plugins/project.json b/packages/analytics-js-plugins/project.json index e388cc91c..0b7d276e3 100644 --- a/packages/analytics-js-plugins/project.json +++ b/packages/analytics-js-plugins/project.json @@ -51,9 +51,9 @@ "github": { "executor": "@jscutlery/semver:github", "options": { - "tag": "@rudderstack/analytics-js-plugins@3.6.4", - "title": "@rudderstack/analytics-js-plugins@3.6.4", - "discussion-category": "@rudderstack/analytics-js-plugins@3.6.4", + "tag": "@rudderstack/analytics-js-plugins@3.6.5", + "title": "@rudderstack/analytics-js-plugins@3.6.5", + "discussion-category": "@rudderstack/analytics-js-plugins@3.6.5", "notesFile": "./packages/analytics-js-plugins/CHANGELOG_LATEST.md" } } diff --git a/packages/analytics-js/CHANGELOG_LATEST.md b/packages/analytics-js/CHANGELOG_LATEST.md index b940ec6d2..41a4e3d27 100644 --- a/packages/analytics-js/CHANGELOG_LATEST.md +++ b/packages/analytics-js/CHANGELOG_LATEST.md @@ -1,7 +1,5 @@ -## [3.11.1](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.11.0...@rudderstack/analytics-js@3.11.1) (2024-11-19) +## [3.11.2](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.11.1...@rudderstack/analytics-js@3.11.2) (2024-11-21) ### Dependency Updates -* `@rudderstack/analytics-js-cookies` updated to version `0.4.4` -* `@rudderstack/analytics-js-common` updated to version `3.14.1` * `@rudderstack/analytics-js-plugins` updated to version `3.6.4` diff --git a/packages/analytics-js/project.json b/packages/analytics-js/project.json index 8cf14ada2..08018c222 100644 --- a/packages/analytics-js/project.json +++ b/packages/analytics-js/project.json @@ -59,9 +59,9 @@ "github": { "executor": "@jscutlery/semver:github", "options": { - "tag": "@rudderstack/analytics-js@3.11.1", - "title": "@rudderstack/analytics-js@3.11.1", - "discussion-category": "@rudderstack/analytics-js@3.11.1", + "tag": "@rudderstack/analytics-js@3.11.2", + "title": "@rudderstack/analytics-js@3.11.2", + "discussion-category": "@rudderstack/analytics-js@3.11.2", "notesFile": "./packages/analytics-js/CHANGELOG_LATEST.md" } } diff --git a/packages/loading-scripts/CHANGELOG_LATEST.md b/packages/loading-scripts/CHANGELOG_LATEST.md index ab9d32a93..8bd403307 100644 --- a/packages/loading-scripts/CHANGELOG_LATEST.md +++ b/packages/loading-scripts/CHANGELOG_LATEST.md @@ -1,5 +1,5 @@ -## [3.0.44](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-loading-scripts@3.0.43...@rudderstack/analytics-js-loading-scripts@3.0.44) (2024-11-19) +## [3.0.45](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-loading-scripts@3.0.44...@rudderstack/analytics-js-loading-scripts@3.0.45) (2024-11-21) ### Dependency Updates -* `@rudderstack/analytics-js` updated to version `3.11.1` +* `@rudderstack/analytics-js` updated to version `3.11.2` diff --git a/packages/loading-scripts/project.json b/packages/loading-scripts/project.json index 211272768..ed516037b 100644 --- a/packages/loading-scripts/project.json +++ b/packages/loading-scripts/project.json @@ -51,9 +51,9 @@ "github": { "executor": "@jscutlery/semver:github", "options": { - "tag": "@rudderstack/analytics-js-loading-scripts@3.0.44", - "title": "@rudderstack/analytics-js-loading-scripts@3.0.44", - "discussion-category": "@rudderstack/analytics-js-loading-scripts@3.0.44", + "tag": "@rudderstack/analytics-js-loading-scripts@3.0.45", + "title": "@rudderstack/analytics-js-loading-scripts@3.0.45", + "discussion-category": "@rudderstack/analytics-js-loading-scripts@3.0.45", "notesFile": "./packages/loading-scripts/CHANGELOG_LATEST.md" } } diff --git a/sonar-project.properties b/sonar-project.properties index c78cff149..4b39be28d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -6,7 +6,7 @@ sonar.qualitygate.wait=false sonar.projectKey=rudderlabs_rudder-sdk-js sonar.organization=rudderlabs sonar.projectName=rudder-sdk-js -sonar.projectVersion=3.53.0 +sonar.projectVersion=3.54.0 # Meta-data for the project sonar.links.scm=https://github.com/rudderlabs/rudder-sdk-js From 8150881bf171384c036aeb7e27325d788e31b508 Mon Sep 17 00:00:00 2001 From: Sai Kumar Battinoju Date: Thu, 21 Nov 2024 12:07:03 +0530 Subject: [PATCH 7/8] chore: restore cache control settings --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bfdc3b1b4..8d49aad31 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -49,7 +49,7 @@ permissions: env: NODE_OPTIONS: "--no-warnings" - CACHE_CONTROL: "\"no-store\"" + CACHE_CONTROL: "\"max-age=3600\"" # "\"no-store\"" jobs: deploy: From c9248cb2d33eb9bf1aabe70271e966c81674d3c4 Mon Sep 17 00:00:00 2001 From: AASHISH MALIK Date: Thu, 21 Nov 2024 14:02:04 +0530 Subject: [PATCH 8/8] fix: age format snapPixel (#1933) --- .../integrations/SnapPixel/browser.test.js | 45 +++++++++++++++++++ .../src/integrations/SnapPixel/browser.js | 5 ++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/packages/analytics-js-integrations/__tests__/integrations/SnapPixel/browser.test.js b/packages/analytics-js-integrations/__tests__/integrations/SnapPixel/browser.test.js index d1ea36a32..efc06d051 100644 --- a/packages/analytics-js-integrations/__tests__/integrations/SnapPixel/browser.test.js +++ b/packages/analytics-js-integrations/__tests__/integrations/SnapPixel/browser.test.js @@ -143,6 +143,7 @@ describe('SnapPixel', () => { email: 'test@example.com', firstName: 'John', city: 'San Francisco', + age: '16' }, }, }, @@ -153,6 +154,50 @@ describe('SnapPixel', () => { snapPixel.identify(rudderElement); // Verify only provided parameters are included + expect(window.snaptr.mock.calls[1]).toEqual([ + 'init', + '12345', + { + user_email: 'test@example.com', + firstname: 'John', + geo_city: 'San Francisco', + age: '16' + }, + ]); + }); + + it('should skip age if in object format', () => { + const destinationConfig = { + pixelId: '12345', + deduplicationKey: 'email', + hashMethod: false, + enableDeduplication: false, + eventMappingFromConfig: false, + }; + + const analytics = { + logLevel: 'debug', + getAnonymousId: () => 'ANONYMOUS_ID', + }; + + const rudderElement = { + message: { + context: { + traits: { + email: 'test@example.com', + firstName: 'John', + city: 'San Francisco', + age: { + a: 1, + }, + }, + }, + }, + }; + const snapPixel = new SnapPixel(destinationConfig, analytics, destinationInfo); + snapPixel.init(); + snapPixel.identify(rudderElement); + expect(window.snaptr.mock.calls[1]).toEqual([ 'init', '12345', diff --git a/packages/analytics-js-integrations/src/integrations/SnapPixel/browser.js b/packages/analytics-js-integrations/src/integrations/SnapPixel/browser.js index f9c7371e0..2a897626c 100644 --- a/packages/analytics-js-integrations/src/integrations/SnapPixel/browser.js +++ b/packages/analytics-js-integrations/src/integrations/SnapPixel/browser.js @@ -13,7 +13,7 @@ import { } from '../../utils/commonUtils'; import { ecommEventPayload, eventPayload, getUserEmailAndPhone, sendEvent } from './util'; import { loadNativeSdk } from './nativeSdkLoader'; -import { getDefinedTraits } from '@rudderstack/analytics-js-integrations/utils/utils'; +import { getDefinedTraits } from '../../utils/utils'; const logger = new Logger(DISPLAY_NAME); @@ -117,7 +117,8 @@ class SnapPixel { if (ipAddress) payload.ip_address = ipAddress; if (firstName) payload.firstname = firstName; if (lastName) payload.lastname = lastName; - if (age) payload.age = age; + if (age && (typeof age === 'number' || (!isNaN(Number(age)) && typeof age === 'string'))) + payload.age = age; if (city) payload.geo_city = city; if (state) payload.geo_region = state; if (postalCode) payload.geo_postal_code = postalCode;