@automattic/calypso-analytics
Advanced tools
Comparing version 1.1.0 to 1.1.1
"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.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.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; | ||
/** | ||
@@ -15,2 +15,13 @@ * Re-export | ||
Object.defineProperty(exports, "getMostRecentUrlPath", { enumerable: true, get: function () { return page_view_params_1.getMostRecentUrlPath; } }); | ||
var get_tracking_prefs_1 = require("./utils/get-tracking-prefs"); | ||
Object.defineProperty(exports, "getTrackingPrefs", { enumerable: true, get: function () { return __importDefault(get_tracking_prefs_1).default; } }); | ||
Object.defineProperty(exports, "parseTrackingPrefs", { enumerable: true, get: function () { return get_tracking_prefs_1.parseTrackingPrefs; } }); | ||
Object.defineProperty(exports, "TRACKING_PREFS_COOKIE_V1", { enumerable: true, get: function () { return get_tracking_prefs_1.TRACKING_PREFS_COOKIE_V1; } }); | ||
Object.defineProperty(exports, "TRACKING_PREFS_COOKIE_V2", { enumerable: true, get: function () { return get_tracking_prefs_1.TRACKING_PREFS_COOKIE_V2; } }); | ||
var set_tracking_prefs_1 = require("./utils/set-tracking-prefs"); | ||
Object.defineProperty(exports, "setTrackingPrefs", { enumerable: true, get: function () { return __importDefault(set_tracking_prefs_1).default; } }); | ||
var is_country_in_gdpr_zone_1 = require("./utils/is-country-in-gdpr-zone"); | ||
Object.defineProperty(exports, "isCountryInGdprZone", { enumerable: true, get: function () { return __importDefault(is_country_in_gdpr_zone_1).default; } }); | ||
var is_region_in_ccpa_zone_1 = require("./utils/is-region-in-ccpa-zone"); | ||
Object.defineProperty(exports, "isRegionInCcpaZone", { enumerable: true, get: function () { return __importDefault(is_region_in_ccpa_zone_1).default; } }); | ||
var tracks_1 = require("./tracks"); | ||
@@ -17,0 +28,0 @@ Object.defineProperty(exports, "recordTracksPageView", { enumerable: true, get: function () { return tracks_1.recordTracksPageView; } }); |
@@ -13,2 +13,3 @@ "use strict"; | ||
const do_not_track_1 = tslib_1.__importDefault(require("./utils/do-not-track")); | ||
const get_tracking_prefs_1 = tslib_1.__importDefault(require("./utils/get-tracking-prefs")); | ||
/** | ||
@@ -168,2 +169,7 @@ * Tracks uses a bunch of special query params that should not be used as property name | ||
eventProperties = eventProperties || {}; | ||
const trackingPrefs = (0, get_tracking_prefs_1.default)(); | ||
if (!trackingPrefs?.buckets.analytics) { | ||
(0, debug_1.default)('Analytics has been disabled - Ignoring event "%s" with actual props %o', eventName, eventProperties); | ||
return; | ||
} | ||
if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { | ||
@@ -170,0 +176,0 @@ if (!/^calypso(?:_[a-z0-9]+){2,}$/.test(eventName) && |
@@ -7,4 +7,8 @@ /** | ||
export { getPageViewParams, getMostRecentUrlPath } from './page-view-params'; | ||
export { default as getTrackingPrefs, parseTrackingPrefs, TRACKING_PREFS_COOKIE_V1, TRACKING_PREFS_COOKIE_V2, } from './utils/get-tracking-prefs'; | ||
export { default as setTrackingPrefs } from './utils/set-tracking-prefs'; | ||
export { default as isCountryInGdprZone } from './utils/is-country-in-gdpr-zone'; | ||
export { default as isRegionInCcpaZone } from './utils/is-region-in-ccpa-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 |
@@ -9,2 +9,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import getDoNotTrack from './utils/do-not-track'; | ||
import getTrackingPrefs from './utils/get-tracking-prefs'; | ||
/** | ||
@@ -158,2 +159,7 @@ * Tracks uses a bunch of special query params that should not be used as property name | ||
eventProperties = eventProperties || {}; | ||
const trackingPrefs = getTrackingPrefs(); | ||
if (!trackingPrefs?.buckets.analytics) { | ||
debug('Analytics has been disabled - Ignoring event "%s" with actual props %o', eventName, eventProperties); | ||
return; | ||
} | ||
if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { | ||
@@ -160,0 +166,0 @@ if (!/^calypso(?:_[a-z0-9]+){2,}$/.test(eventName) && |
@@ -7,2 +7,7 @@ /** | ||
export { getPageViewParams, getMostRecentUrlPath } from './page-view-params'; | ||
export { default as getTrackingPrefs, parseTrackingPrefs, TRACKING_PREFS_COOKIE_V1, TRACKING_PREFS_COOKIE_V2, } from './utils/get-tracking-prefs'; | ||
export type { TrackingPrefs } from './utils/get-tracking-prefs'; | ||
export { default as setTrackingPrefs } from './utils/set-tracking-prefs'; | ||
export { default as isCountryInGdprZone } from './utils/is-country-in-gdpr-zone'; | ||
export { default as isRegionInCcpaZone } from './utils/is-region-in-ccpa-zone'; | ||
export { recordTracksPageView, recordTracksPageViewWithPageParams, recordTracksEvent, identifyUser, initializeAnalytics, getTracksAnonymousUserId, getTracksLoadPromise, analyticsEvents, pushEventToTracksQueue, getGenericSuperPropsGetter, } from './tracks'; | ||
@@ -9,0 +14,0 @@ export { recordTrainTracksRender, recordTrainTracksInteract, getNewRailcarId, } from './train-tracks'; |
{ | ||
"name": "@automattic/calypso-analytics", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Automattic Analytics.", | ||
@@ -42,4 +42,4 @@ "homepage": "https://github.com/Automattic/wp-calypso", | ||
"@automattic/calypso-typescript-config": "^1.0.0", | ||
"typescript": "^5.2.2" | ||
"typescript": "^5.3.2" | ||
} | ||
} |
@@ -8,2 +8,12 @@ /** | ||
export { | ||
default as getTrackingPrefs, | ||
parseTrackingPrefs, | ||
TRACKING_PREFS_COOKIE_V1, | ||
TRACKING_PREFS_COOKIE_V2, | ||
} from './utils/get-tracking-prefs'; | ||
export type { TrackingPrefs } from './utils/get-tracking-prefs'; | ||
export { default as setTrackingPrefs } from './utils/set-tracking-prefs'; | ||
export { default as isCountryInGdprZone } from './utils/is-country-in-gdpr-zone'; | ||
export { default as isRegionInCcpaZone } from './utils/is-region-in-ccpa-zone'; | ||
export { | ||
recordTracksPageView, | ||
@@ -10,0 +20,0 @@ recordTracksPageViewWithPageParams, |
@@ -10,2 +10,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import getDoNotTrack from './utils/do-not-track'; | ||
import getTrackingPrefs from './utils/get-tracking-prefs'; | ||
@@ -191,2 +192,12 @@ declare global { | ||
const trackingPrefs = getTrackingPrefs(); | ||
if ( ! trackingPrefs?.buckets.analytics ) { | ||
debug( | ||
'Analytics has been disabled - Ignoring event "%s" with actual props %o', | ||
eventName, | ||
eventProperties | ||
); | ||
return; | ||
} | ||
if ( process.env.NODE_ENV !== 'production' && typeof console !== 'undefined' ) { | ||
@@ -193,0 +204,0 @@ if ( |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
187788
90
2110
1