Socket
Socket
Sign inDemoInstall

@automattic/calypso-analytics

Package Overview
Dependencies
Maintainers
50
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automattic/calypso-analytics - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

dist/cjs/utils/is-region-in-sts-zone.js

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 1.1.2
- Add additional 8 US states to the list of CCPA regions (DE, IN, IA, MT, NJ, OR, TN, TX).
## 1.1.1

@@ -2,0 +6,0 @@

4

dist/cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNewRailcarId = exports.recordTrainTracksInteract = exports.recordTrainTracksRender = exports.getGenericSuperPropsGetter = exports.pushEventToTracksQueue = exports.analyticsEvents = exports.getTracksLoadPromise = exports.getTracksAnonymousUserId = exports.initializeAnalytics = exports.identifyUser = exports.recordTracksEvent = exports.recordTracksPageViewWithPageParams = exports.recordTracksPageView = exports.isRegionInCcpaZone = exports.isCountryInGdprZone = exports.setTrackingPrefs = exports.TRACKING_PREFS_COOKIE_V2 = exports.TRACKING_PREFS_COOKIE_V1 = exports.parseTrackingPrefs = exports.getTrackingPrefs = exports.getMostRecentUrlPath = exports.getPageViewParams = exports.setCurrentUser = exports.getCurrentUser = exports.getDoNotTrack = void 0;
exports.getNewRailcarId = exports.recordTrainTracksInteract = exports.recordTrainTracksRender = exports.getGenericSuperPropsGetter = exports.pushEventToTracksQueue = exports.analyticsEvents = exports.getTracksLoadPromise = exports.getTracksAnonymousUserId = exports.initializeAnalytics = exports.identifyUser = exports.recordTracksEvent = exports.recordTracksPageViewWithPageParams = exports.recordTracksPageView = exports.isRegionInStsZone = exports.isRegionInCcpaZone = exports.isCountryInGdprZone = exports.setTrackingPrefs = exports.TRACKING_PREFS_COOKIE_V2 = exports.TRACKING_PREFS_COOKIE_V1 = exports.parseTrackingPrefs = exports.getTrackingPrefs = exports.getMostRecentUrlPath = exports.getPageViewParams = exports.setCurrentUser = exports.getCurrentUser = exports.getDoNotTrack = void 0;
/**

@@ -26,2 +26,4 @@ * Re-export

Object.defineProperty(exports, "isRegionInCcpaZone", { enumerable: true, get: function () { return __importDefault(is_region_in_ccpa_zone_1).default; } });
var is_region_in_sts_zone_1 = require("./utils/is-region-in-sts-zone");
Object.defineProperty(exports, "isRegionInStsZone", { enumerable: true, get: function () { return __importDefault(is_region_in_sts_zone_1).default; } });
var tracks_1 = require("./tracks");

@@ -28,0 +30,0 @@ Object.defineProperty(exports, "recordTracksPageView", { enumerable: true, get: function () { return tracks_1.recordTracksPageView; } });

@@ -38,3 +38,3 @@ "use strict";

if (typeof document !== 'undefined') {
_loadTracksResult = (0, load_script_1.loadScript)('//stats.wp.com/w.js?64');
_loadTracksResult = (0, load_script_1.loadScript)('//stats.wp.com/w.js?67');
}

@@ -116,3 +116,2 @@ function createRandomId(randomBytesLength = 9) {

* Returns the anoymous id stored in the `tk_ai` cookie
*
* @returns The Tracks anonymous user id

@@ -136,2 +135,7 @@ */

}
const tracksLinkerId = getUrlParameter('_tkl');
if (tracksLinkerId && tracksLinkerId !== getTracksAnonymousUserId()) {
// Link tk_ai anonymous ids if _tkl parameter is present in URL and ids between pages are different (e.g. cross-domain)
signalUserFromAnotherProduct('anon', tracksLinkerId);
}
// Tracks blocked?

@@ -241,10 +245,13 @@ (0, debug_1.default)('checkForBlockedTracks');

}
// Record all `utm` marketing parameters as event properties on the page view event
// Record some query parameters as event properties on the page view event
// so we can analyze their performance with our analytics tools
if (typeof window !== 'undefined' && window.location) {
const urlParams = new URL(window.location.href).searchParams;
// Record all `utm` marketing params.
const utmParamEntries = urlParams &&
Array.from(urlParams.entries()).filter(([key]) => key.startsWith('utm_'));
const utmParams = utmParamEntries ? Object.fromEntries(utmParamEntries) : {};
eventProperties = Object.assign(eventProperties, utmParams);
// Record the 'ref' param.
const refParam = urlParams && urlParams.get('ref') ? { ref: urlParams.get('ref') } : {};
eventProperties = Object.assign(eventProperties, { ...utmParams, ...refParam });
}

@@ -251,0 +258,0 @@ recordTracksEvent('calypso_page_view', eventProperties);

@@ -12,3 +12,2 @@ "use strict";

* Gets current user.
*
* @returns Current user.

@@ -22,3 +21,2 @@ */

* Sets current user, (stored in javascript memory).
*
* @param currentUser the user data for the current user

@@ -25,0 +23,0 @@ * @returns Current user.

@@ -7,3 +7,2 @@ "use strict";

* Whether Do Not Track is enabled in the user's browser.
*
* @returns true if Do Not Track is enabled in the user's browser.

@@ -10,0 +9,0 @@ */

@@ -7,3 +7,2 @@ "use strict";

* Hashes users' Personally Identifiable Information using SHA256
*
* @param data Data to be hashed

@@ -10,0 +9,0 @@ * @returns SHA256 in hex string format

@@ -9,2 +9,10 @@ "use strict";

'virginia', // VA
'texas', // TX
'tennessee', // TN
'oregon', // OR
'new jersey', // NJ
'montana', // MT
'iowa', // IA
'indiana', // IN
'delaware', // DE
];

@@ -11,0 +19,0 @@ /**

@@ -11,4 +11,5 @@ /**

export { default as isRegionInCcpaZone } from './utils/is-region-in-ccpa-zone';
export { default as isRegionInStsZone } from './utils/is-region-in-sts-zone';
export { recordTracksPageView, recordTracksPageViewWithPageParams, recordTracksEvent, identifyUser, initializeAnalytics, getTracksAnonymousUserId, getTracksLoadPromise, analyticsEvents, pushEventToTracksQueue, getGenericSuperPropsGetter, } from './tracks';
export { recordTrainTracksRender, recordTrainTracksInteract, getNewRailcarId, } from './train-tracks';
//# sourceMappingURL=index.js.map

@@ -34,3 +34,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

if (typeof document !== 'undefined') {
_loadTracksResult = loadScript('//stats.wp.com/w.js?64');
_loadTracksResult = loadScript('//stats.wp.com/w.js?67');
}

@@ -110,3 +110,2 @@ function createRandomId(randomBytesLength = 9) {

* Returns the anoymous id stored in the `tk_ai` cookie
*
* @returns The Tracks anonymous user id

@@ -129,2 +128,7 @@ */

}
const tracksLinkerId = getUrlParameter('_tkl');
if (tracksLinkerId && tracksLinkerId !== getTracksAnonymousUserId()) {
// Link tk_ai anonymous ids if _tkl parameter is present in URL and ids between pages are different (e.g. cross-domain)
signalUserFromAnotherProduct('anon', tracksLinkerId);
}
// Tracks blocked?

@@ -230,10 +234,13 @@ debug('checkForBlockedTracks');

}
// Record all `utm` marketing parameters as event properties on the page view event
// Record some query parameters as event properties on the page view event
// so we can analyze their performance with our analytics tools
if (typeof window !== 'undefined' && window.location) {
const urlParams = new URL(window.location.href).searchParams;
// Record all `utm` marketing params.
const utmParamEntries = urlParams &&
Array.from(urlParams.entries()).filter(([key]) => key.startsWith('utm_'));
const utmParams = utmParamEntries ? Object.fromEntries(utmParamEntries) : {};
eventProperties = Object.assign(eventProperties, utmParams);
// Record the 'ref' param.
const refParam = urlParams && urlParams.get('ref') ? { ref: urlParams.get('ref') } : {};
eventProperties = Object.assign(eventProperties, { ...utmParams, ...refParam });
}

@@ -240,0 +247,0 @@ recordTracksEvent('calypso_page_view', eventProperties);

@@ -8,3 +8,2 @@ import hashPii from './hash-pii';

* Gets current user.
*
* @returns Current user.

@@ -17,3 +16,2 @@ */

* Sets current user, (stored in javascript memory).
*
* @param currentUser the user data for the current user

@@ -20,0 +18,0 @@ * @returns Current user.

import debug from './debug';
/**
* Whether Do Not Track is enabled in the user's browser.
*
* @returns true if Do Not Track is enabled in the user's browser.

@@ -6,0 +5,0 @@ */

import sha256 from 'hash.js/lib/hash/sha/256';
/**
* Hashes users' Personally Identifiable Information using SHA256
*
* @param data Data to be hashed

@@ -6,0 +5,0 @@ * @returns SHA256 in hex string format

@@ -7,2 +7,10 @@ const CCPA_US_REGIONS = [

'virginia', // VA
'texas', // TX
'tennessee', // TN
'oregon', // OR
'new jersey', // NJ
'montana', // MT
'iowa', // IA
'indiana', // IN
'delaware', // DE
];

@@ -9,0 +17,0 @@ /**

@@ -12,2 +12,3 @@ /**

export { default as isRegionInCcpaZone } from './utils/is-region-in-ccpa-zone';
export { default as isRegionInStsZone } from './utils/is-region-in-sts-zone';
export { recordTracksPageView, recordTracksPageViewWithPageParams, recordTracksEvent, identifyUser, initializeAnalytics, getTracksAnonymousUserId, getTracksLoadPromise, analyticsEvents, pushEventToTracksQueue, getGenericSuperPropsGetter, } from './tracks';

@@ -14,0 +15,0 @@ export { recordTrainTracksRender, recordTrainTracksInteract, getNewRailcarId, } from './train-tracks';

@@ -16,3 +16,2 @@ /// <reference types="node" />

* Returns the anoymous id stored in the `tk_ai` cookie
*
* @returns The Tracks anonymous user id

@@ -19,0 +18,0 @@ */

@@ -19,3 +19,2 @@ export interface SetCurrentUserParams {

* Gets current user.
*
* @returns Current user.

@@ -26,3 +25,2 @@ */

* Sets current user, (stored in javascript memory).
*
* @param currentUser the user data for the current user

@@ -29,0 +27,0 @@ * @returns Current user.

/**
* Whether Do Not Track is enabled in the user's browser.
*
* @returns true if Do Not Track is enabled in the user's browser.

@@ -5,0 +4,0 @@ */

/**
* Hashes users' Personally Identifiable Information using SHA256
*
* @param data Data to be hashed

@@ -5,0 +4,0 @@ * @returns SHA256 in hex string format

{
"name": "@automattic/calypso-analytics",
"version": "1.1.1",
"version": "1.1.2",
"description": "Automattic Analytics.",

@@ -38,8 +38,8 @@ "homepage": "https://github.com/Automattic/wp-calypso",

"tslib": "^2.3.0",
"uuid": "^8.3.2"
"uuid": "^9.0.1"
},
"devDependencies": {
"@automattic/calypso-typescript-config": "^1.0.0",
"typescript": "^5.3.2"
"typescript": "^5.3.3"
}
}

@@ -17,2 +17,3 @@ /**

export { default as isRegionInCcpaZone } from './utils/is-region-in-ccpa-zone';
export { default as isRegionInStsZone } from './utils/is-region-in-sts-zone';
export {

@@ -19,0 +20,0 @@ recordTracksPageView,

@@ -45,3 +45,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

if ( typeof document !== 'undefined' ) {
_loadTracksResult = loadScript( '//stats.wp.com/w.js?64' );
_loadTracksResult = loadScript( '//stats.wp.com/w.js?67' );
}

@@ -130,3 +130,2 @@

* Returns the anoymous id stored in the `tk_ai` cookie
*
* @returns The Tracks anonymous user id

@@ -156,2 +155,8 @@ */

const tracksLinkerId = getUrlParameter( '_tkl' );
if ( tracksLinkerId && tracksLinkerId !== getTracksAnonymousUserId() ) {
// Link tk_ai anonymous ids if _tkl parameter is present in URL and ids between pages are different (e.g. cross-domain)
signalUserFromAnotherProduct( 'anon', tracksLinkerId );
}
// Tracks blocked?

@@ -302,6 +307,8 @@ debug( 'checkForBlockedTracks' );

// Record all `utm` marketing parameters as event properties on the page view event
// Record some query parameters as event properties on the page view event
// so we can analyze their performance with our analytics tools
if ( typeof window !== 'undefined' && window.location ) {
const urlParams = new URL( window.location.href ).searchParams;
// Record all `utm` marketing params.
const utmParamEntries =

@@ -312,3 +319,6 @@ urlParams &&

eventProperties = Object.assign( eventProperties, utmParams );
// Record the 'ref' param.
const refParam = urlParams && urlParams.get( 'ref' ) ? { ref: urlParams.get( 'ref' ) } : {};
eventProperties = Object.assign( eventProperties, { ...utmParams, ...refParam } );
}

@@ -315,0 +325,0 @@

@@ -29,3 +29,2 @@ import hashPii from './hash-pii';

* Gets current user.
*
* @returns Current user.

@@ -39,3 +38,2 @@ */

* Sets current user, (stored in javascript memory).
*
* @param currentUser the user data for the current user

@@ -42,0 +40,0 @@ * @returns Current user.

@@ -5,3 +5,2 @@ import debug from './debug';

* Whether Do Not Track is enabled in the user's browser.
*
* @returns true if Do Not Track is enabled in the user's browser.

@@ -8,0 +7,0 @@ */

@@ -5,3 +5,2 @@ import sha256 from 'hash.js/lib/hash/sha/256';

* Hashes users' Personally Identifiable Information using SHA256
*
* @param data Data to be hashed

@@ -8,0 +7,0 @@ * @returns SHA256 in hex string format

@@ -7,2 +7,10 @@ const CCPA_US_REGIONS = [

'virginia', // VA
'texas', // TX
'tennessee', // TN
'oregon', // OR
'new jersey', // NJ
'montana', // MT
'iowa', // IA
'indiana', // IN
'delaware', // DE
];

@@ -9,0 +17,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc