Skip to content

Commit

Permalink
chore(release): pull hotfix-release/3.27.0 into main (#1807)
Browse files Browse the repository at this point in the history
  • Loading branch information
utsabc authored Jul 24, 2024
2 parents 7dd90a6 + 3f09c58 commit 2d65fe1
Show file tree
Hide file tree
Showing 47 changed files with 246 additions and 83 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rudderstack/analytics-js-monorepo",
"version": "3.26.0",
"version": "3.27.0",
"private": true,
"description": "Monorepo for RudderStack Analytics JS SDK",
"workspaces": [
Expand Down
7 changes: 7 additions & 0 deletions packages/analytics-js-common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [3.8.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected]...@rudderstack/[email protected]) (2024-07-24)


### Features

* **analytics-js-integrations:** onboard ga4 v2 hybrid mode ([#1802](https://github.com/rudderlabs/rudder-sdk-js/issues/1802)) ([2c8c3be](https://github.com/rudderlabs/rudder-sdk-js/commit/2c8c3bea8ada300c62729eb114dbe8ff84ae9269))

## [3.7.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected]...@rudderstack/[email protected]) (2024-07-19)


Expand Down
9 changes: 2 additions & 7 deletions packages/analytics-js-common/CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
## [3.7.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-common@3.6.1...@rudderstack/analytics-js-common@3.7.0) (2024-07-19)
## [3.8.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js-common@3.7.0...@rudderstack/analytics-js-common@3.8.0) (2024-07-24)


### Features

* error reporting plugin ([#1601](https://github.com/rudderlabs/rudder-sdk-js/issues/1601)) ([1f2629e](https://github.com/rudderlabs/rudder-sdk-js/commit/1f2629e594740763ce9bd54a21213b92d80ae085))


### Bug Fixes

* event API overloads ([#1782](https://github.com/rudderlabs/rudder-sdk-js/issues/1782)) ([02c5b47](https://github.com/rudderlabs/rudder-sdk-js/commit/02c5b47d0a83250fb5180e9ed467a92361663dab))
* **analytics-js-integrations:** onboard ga4 v2 hybrid mode ([#1802](https://github.com/rudderlabs/rudder-sdk-js/issues/1802)) ([2c8c3be](https://github.com/rudderlabs/rudder-sdk-js/commit/2c8c3bea8ada300c62729eb114dbe8ff84ae9269))

2 changes: 1 addition & 1 deletion packages/analytics-js-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rudderstack/analytics-js-common",
"version": "3.7.0",
"version": "3.8.0",
"private": true,
"description": "RudderStack JavaScript SDK common code",
"module": "dist/npm/index.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/analytics-js-common/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"github": {
"executor": "@jscutlery/semver:github",
"options": {
"tag": "@rudderstack/analytics-js-common@3.7.0",
"title": "@rudderstack/analytics-js-common@3.7.0",
"discussion-category": "@rudderstack/analytics-js-common@3.7.0",
"tag": "@rudderstack/analytics-js-common@3.8.0",
"title": "@rudderstack/analytics-js-common@3.8.0",
"discussion-category": "@rudderstack/analytics-js-common@3.8.0",
"notesFile": "./packages/analytics-js-common/CHANGELOG_LATEST.md"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import {
TVSquaredDirectoryName,
GA4DisplayName,
GA4DirectoryName,
GA4_V2DisplayName,
GA4_V2DirectoryName,
MoEngageDisplayName,
MoEngageDirectoryName,
AmplitudeDisplayName,
Expand Down Expand Up @@ -180,6 +182,7 @@ const destDisplayNamesToFileNamesMap: Record<string, string> = {
[FullstoryDisplayName]: FullstoryDirectoryName,
[TVSquaredDisplayName]: TVSquaredDirectoryName,
[GA4DisplayName]: GA4DirectoryName,
[GA4_V2DisplayName]: GA4_V2DirectoryName,
[MoEngageDisplayName]: MoEngageDirectoryName,
[AmplitudeDisplayName]: AmplitudeDirectoryName,
[PendoDisplayName]: PendoDirectoryName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export {
DISPLAY_NAME as GA4DisplayName,
DIR_NAME as GA4DirectoryName,
} from './integrations/GA4/constants';
export {
DISPLAY_NAME as GA4_V2DisplayName,
DIR_NAME as GA4_V2DirectoryName,

Check warning on line 67 in packages/analytics-js-common/src/constants/destinationNames.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-common/src/constants/destinationNames.ts#L65-L67

Added lines #L65 - L67 were not covered by tests
} from './integrations/GA4_V2/constants';
export {
DISPLAY_NAME as GoogleAdsDisplayName,
DIR_NAME as GoogleAdsDirectoryName,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const DIR_NAME = 'GA4_V2';
const NAME = 'GA4_V2';
const DISPLAY_NAME = 'Google Analytics 4 (GA4) V2';

Check warning on line 3 in packages/analytics-js-common/src/constants/integrations/GA4_V2/constants.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-common/src/constants/integrations/GA4_V2/constants.ts#L1-L3

Added lines #L1 - L3 were not covered by tests

const DISPLAY_NAME_TO_DIR_NAME_MAP = { [DISPLAY_NAME]: DIR_NAME };
const CNameMapping = {

Check warning on line 6 in packages/analytics-js-common/src/constants/integrations/GA4_V2/constants.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-common/src/constants/integrations/GA4_V2/constants.ts#L5-L6

Added lines #L5 - L6 were not covered by tests
[NAME]: NAME,
'Google Analytics 4 V2': NAME,
'Google analytics 4 V2': NAME,
'google analytics 4 V2': NAME,
'Google Analytics4 V2': NAME,
'Google analytics4 V2': NAME,
'google analytics4 V2': NAME,
'Google Analytics 4 (GA4) V2': NAME,
'google analytics 4 (ga4) V2': NAME,
GoogleAnalytics4V2: NAME,
};

export { NAME, CNameMapping, DISPLAY_NAME_TO_DIR_NAME_MAP, DISPLAY_NAME, DIR_NAME };

Check warning on line 19 in packages/analytics-js-common/src/constants/integrations/GA4_V2/constants.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-common/src/constants/integrations/GA4_V2/constants.ts#L19

Added line #L19 was not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const clientToServerNames = {
FULLSTORY: 'Fullstory',
TVSQUARED: 'TVSquared',
GA4: 'Google Analytics 4 (GA4)',
GA4_V2: 'Google Analytics 4 (GA4) V2',
MOENGAGE: 'MoEngage',
AM: 'Amplitude',
PENDO: 'Pendo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const configToIntNames = {
FULLSTORY: 'Fullstory',
TVSQUARED: 'TVSquared',
GA4: 'GA4',
GA4_V2: 'GA4_V2',
MOENGAGE: 'MoEngage',
AM: 'Amplitude',
PENDO: 'Pendo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CNameMapping as FacebookPixel } from '../../constants/integrations/Face
import { CNameMapping as Fullstory } from '../../constants/integrations/Fullstory/constants';
import { CNameMapping as GA } from '../../constants/integrations/GA/constants';
import { CNameMapping as GA4 } from '../../constants/integrations/GA4/constants';
import { CNameMapping as GA4_V2 } from '../../constants/integrations/GA4_V2/constants';

Check warning on line 17 in packages/analytics-js-common/src/v1.1/utils/integration_cname.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-common/src/v1.1/utils/integration_cname.js#L17

Added line #L17 was not covered by tests
import { CNameMapping as GoogleAds } from '../../constants/integrations/GoogleAds/constants';
import { CNameMapping as GoogleOptimize } from '../../constants/integrations/GoogleOptimize/constants';
import { CNameMapping as GoogleTagManager } from '../../constants/integrations/GoogleTagManager/constants';
Expand Down Expand Up @@ -98,6 +99,7 @@ const commonNames = {
...Fullstory,
...GA,
...GA4,
...GA4_V2,
...GA360,
...GoogleAds,
...GoogleOptimize,
Expand Down
5 changes: 5 additions & 0 deletions packages/analytics-js-cookies/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [0.3.4](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected]...@rudderstack/[email protected]) (2024-07-24)

### Dependency Updates

* `@rudderstack/analytics-js-common` updated to version `0.3.3`
## [0.3.3](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected]...@rudderstack/[email protected]) (2024-07-19)

### Dependency Updates
Expand Down
9 changes: 2 additions & 7 deletions packages/analytics-js-cookies/CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
## [0.3.3](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected].2...@rudderstack/[email protected].3) (2024-07-19)
## [0.3.4](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected].3...@rudderstack/[email protected].4) (2024-07-24)

### Dependency Updates

* `@rudderstack/analytics-js-common` updated to version `0.3.2`

### Bug Fixes

* event API overloads ([#1782](https://github.com/rudderlabs/rudder-sdk-js/issues/1782)) ([02c5b47](https://github.com/rudderlabs/rudder-sdk-js/commit/02c5b47d0a83250fb5180e9ed467a92361663dab))

* `@rudderstack/analytics-js-common` updated to version `0.3.3`
2 changes: 1 addition & 1 deletion packages/analytics-js-cookies/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rudderstack/analytics-js-cookies",
"version": "0.3.3",
"version": "0.3.4",
"description": "RudderStack JavaScript SDK Cookies Utilities",
"main": "dist/npm/modern/cjs/index.cjs",
"module": "dist/npm/modern/esm/index.mjs",
Expand Down
6 changes: 3 additions & 3 deletions packages/analytics-js-cookies/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"github": {
"executor": "@jscutlery/semver:github",
"options": {
"tag": "@rudderstack/[email protected].3",
"title": "@rudderstack/[email protected].3",
"discussion-category": "@rudderstack/[email protected].3",
"tag": "@rudderstack/[email protected].4",
"title": "@rudderstack/[email protected].4",
"discussion-category": "@rudderstack/[email protected].4",
"notesFile": "./packages/analytics-js-cookies/CHANGELOG_LATEST.md"
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/analytics-js-integrations/.size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ module.exports = [
{
name: 'All Integrations - Legacy - CDN',
path: 'dist/cdn/legacy/js-integrations/*.min.js',
limit: '93 KiB',
limit: '95.3 KiB',
},
{
name: 'All Integrations - Modern - CDN',
path: 'dist/cdn/modern/js-integrations/*.min.js',
limit: '88 KiB',
limit: '91 KiB',
},
];
10 changes: 10 additions & 0 deletions packages/analytics-js-integrations/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [3.5.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected]...@rudderstack/[email protected]) (2024-07-24)

### Dependency Updates

* `@rudderstack/analytics-js-common` updated to version `3.4.5`

### Features

* **analytics-js-integrations:** onboard ga4 v2 hybrid mode ([#1802](https://github.com/rudderlabs/rudder-sdk-js/issues/1802)) ([2c8c3be](https://github.com/rudderlabs/rudder-sdk-js/commit/2c8c3bea8ada300c62729eb114dbe8ff84ae9269))

## [3.4.5](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected]...@rudderstack/[email protected]) (2024-07-19)

### Dependency Updates
Expand Down
8 changes: 4 additions & 4 deletions packages/analytics-js-integrations/CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## [3.4.5](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected].4...@rudderstack/analytics-js-integrations@3.4.5) (2024-07-19)
## [3.5.0](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/[email protected].5...@rudderstack/analytics-js-integrations@3.5.0) (2024-07-24)

### Dependency Updates

* `@rudderstack/analytics-js-common` updated to version `3.4.4`
* `@rudderstack/analytics-js-common` updated to version `3.4.5`

### Bug Fixes
### Features

* event API overloads ([#1782](https://github.com/rudderlabs/rudder-sdk-js/issues/1782)) ([02c5b47](https://github.com/rudderlabs/rudder-sdk-js/commit/02c5b47d0a83250fb5180e9ed467a92361663dab))
* **analytics-js-integrations:** onboard ga4 v2 hybrid mode ([#1802](https://github.com/rudderlabs/rudder-sdk-js/issues/1802)) ([2c8c3be](https://github.com/rudderlabs/rudder-sdk-js/commit/2c8c3bea8ada300c62729eb114dbe8ff84ae9269))

2 changes: 1 addition & 1 deletion packages/analytics-js-integrations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rudderstack/analytics-js-integrations",
"version": "3.4.5",
"version": "3.5.0",
"private": true,
"description": "RudderStack JavaScript SDK device mode integrations",
"main": "dist/npm/modern/cjs/index.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/analytics-js-integrations/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"github": {
"executor": "@jscutlery/semver:github",
"options": {
"tag": "@rudderstack/analytics-js-integrations@3.4.5",
"title": "@rudderstack/analytics-js-integrations@3.4.5",
"discussion-category": "@rudderstack/analytics-js-integrations@3.4.5",
"tag": "@rudderstack/analytics-js-integrations@3.5.0",
"title": "@rudderstack/analytics-js-integrations@3.5.0",
"discussion-category": "@rudderstack/analytics-js-integrations@3.5.0",
"notesFile": "./packages/analytics-js-integrations/CHANGELOG_LATEST.md"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default class GA4 {
this.overrideClientAndSessionId = config.overrideClientAndSessionId || false;
this.sdkBaseUrl =
removeTrailingSlashes(config.sdkBaseUrl) || 'https://www.googletagmanager.com';
this.isExtendedGa4_V2 = config.isExtendedGa4_V2 || false;
({
shouldApplyDeviceModeTransformation: this.shouldApplyDeviceModeTransformation,
propagateEventsUntransformedOnError: this.propagateEventsUntransformedOnError,
Expand Down Expand Up @@ -70,7 +71,7 @@ export default class GA4 {
gtagParameterObject.cookie_prefix = 'rs';
gtagParameterObject.client_id = this.analytics.getAnonymousId();
gtagParameterObject.session_id = this.analytics.getSessionId();
} else {
} else if(!this.isExtendedGa4_V2){
// Cookie migration logic
const clientCookie = this.cookie.get('rs_ga');
const defaultGA4Cookie = this.cookie.get('_ga');
Expand Down Expand Up @@ -260,4 +261,15 @@ export default class GA4 {
},
};
}

// Is used in GA4_V2
getClientDetails() {
return {

Check warning on line 267 in packages/analytics-js-integrations/src/integrations/GA4/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4/browser.js#L267

Added line #L267 was not covered by tests
clientId: this.clientId,
sessionId: this.sessionId,
sessionNumber: this.sessionNumber,
};
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import {
NAME,
DISPLAY_NAME,
} from '@rudderstack/analytics-js-common/constants/integrations/GA4_V2/constants';
import { isDefinedAndNotNull } from '../../utils/commonUtils';
import Logger from '../../utils/logger';
import { GA4 } from '../GA4';

const logger = new Logger(DISPLAY_NAME);

// eslint-disable-next-line @typescript-eslint/naming-convention
export default class GA4_V2 extends GA4 {
constructor(config, analytics, destinationInfo) {
if (analytics.logLevel) {
logger.setLogLevel(analytics.logLevel);

Check warning on line 15 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L15

Added line #L15 was not covered by tests
}

const newConfig = { ...config };
/**
* Sample configData
* "{\"ACCOUNT\":\"321500532\",\"PROPERTY\":\"449999397\",\"DATA_STREAM\":{\"value\":\"G-Q3C88MMDW1\",\"type\":\"gtag\"},\"MEASUREMENT_PROTOCOL_SECRET\":\"sample_secret\"}";
*/

if (isDefinedAndNotNull(config.configData)) {
const configDetails = JSON.parse(config.configData);
newConfig.propertyId = configDetails.PROPERTY;
newConfig.typesOfClient = configDetails.DATA_STREAM.type;

Check warning on line 27 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L25-L27

Added lines #L25 - L27 were not covered by tests
if (newConfig.typesOfClient !== 'gtag') {
logger.error('Invalid typesOfClient. Please select gtag');

Check warning on line 29 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L29

Added line #L29 was not covered by tests
}
newConfig.measurementId = configDetails.DATA_STREAM.value;

Check warning on line 31 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L31

Added line #L31 was not covered by tests
}

if (!isDefinedAndNotNull(newConfig.measurementId)) {
logger.error('Measurement ID is required for GA4');
}

newConfig.isExtendedGa4_V2 = true;
super(newConfig, analytics, destinationInfo);
this.analytics = analytics;
this.name = NAME;
({
shouldApplyDeviceModeTransformation: this.shouldApplyDeviceModeTransformation,
propagateEventsUntransformedOnError: this.propagateEventsUntransformedOnError,
destinationId: this.destinationId,
} = destinationInfo ?? {});
}

init() {
return super.init();

Check warning on line 50 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L50

Added line #L50 was not covered by tests
}

isLoaded() {
return super.isLoaded();

Check warning on line 54 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L54

Added line #L54 was not covered by tests
}

isReady() {
return super.isReady();

Check warning on line 58 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L58

Added line #L58 was not covered by tests
}

identify(rudderElement) {
return super.identify(rudderElement);

Check warning on line 62 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L62

Added line #L62 was not covered by tests
}

track(rudderElement) {
return super.track(rudderElement);

Check warning on line 66 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L66

Added line #L66 was not covered by tests
}

page(rudderElement) {
return super.page(rudderElement);

Check warning on line 70 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L70

Added line #L70 was not covered by tests
}

group(rudderElement) {
return super.group(rudderElement);

Check warning on line 74 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L74

Added line #L74 was not covered by tests
}

getDataForIntegrationsObject() {
const { clientId, sessionId, sessionNumber } = super.getClientDetails();
return {

Check warning on line 79 in packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-integrations/src/integrations/GA4_V2/browser.js#L78-L79

Added lines #L78 - L79 were not covered by tests
[DISPLAY_NAME]: {
clientId,
sessionId,
sessionNumber,
},
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as GA4_V2 } from './browser';
Loading

0 comments on commit 2d65fe1

Please sign in to comment.