diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fa3260..0628f0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ # Changelog +## 6.14.0 +### New +- [browser] New consent methods using `purposes` + +### Changes +- All events properties can now be overridden (using setProperty(ies) or specifying the property directly in events sent) + +### Fixes +- Fixed a conflict with global variables used in multiple taggings + ## 6.13.1 ### Fixes - [browser] Cookie testing is now secure on suitable URLs diff --git a/package.json b/package.json index 837f455..11ff251 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "piano-analytics-js", "description": "JavaScript library for Piano Analytics", - "version": "6.13.1", + "version": "6.14.0", "main": "dist/browserless/piano-analytics.cjs.js", "module": "dist/browserless/piano-analytics.esm.js", "browser": "dist/browser/piano-analytics.umd.js", @@ -37,13 +37,13 @@ "test:node": "npm run rollup:node && node test/node.run.js" }, "devDependencies": { - "@babel/core": "7.22.15", - "@babel/preset-env": "7.22.15", - "@rollup/plugin-babel": "6.0.3", + "@babel/core": "7.23.7", + "@babel/preset-env": "7.23.8", + "@rollup/plugin-babel": "6.0.4", "chai": "4.3.8", - "eslint": "8.48.0", + "eslint": "8.56.0", "eslint-config-standard": "17.1.0", - "eslint-plugin-import": "2.28.1", + "eslint-plugin-import": "2.29.1", "eslint-plugin-node": "11.1.0", "eslint-plugin-promise": "6.1.1", "grunt": "1.6.1", @@ -55,7 +55,7 @@ "karma-mocha": "2.0.1", "load-grunt-tasks": "5.1.0", "mocha": "10.2.0", - "puppeteer": "19.6.2", + "puppeteer": "21.9.0", "rollup": "2.79.1", "rollup-plugin-eslint": "7.0.0", "rollup-plugin-replace": "2.2.0", diff --git a/src/business/privacy/dl-privacy.js b/src/business/privacy/dl-privacy.js index bcdb1ab..692a40e 100644 --- a/src/business/privacy/dl-privacy.js +++ b/src/business/privacy/dl-privacy.js @@ -36,6 +36,9 @@ function DlPrivacy(pa) { 'visitor_privacy_mode': 'custom' } }; + const isConsentv2 = function () { + return window.pdl.requireConsent === 'v2'; + }; this.init = function () { this.consentItems = getConsentItems(); @@ -54,7 +57,7 @@ function DlPrivacy(pa) { productName: 'PA', items: this.consentItems.cookieItems }); - if(!pa.getConfiguration('isLegacyPrivacy')){ + if (!pa.getConfiguration('isLegacyPrivacy')) { this.initMode(); this.filterKeys(); } @@ -91,6 +94,19 @@ function DlPrivacy(pa) { this.modeMetadata['custom'].visitor_privacy_mode = modeName || 'custom'; this.modeMetadata['custom'].visitor_privacy_consent = consentValue; }; + this.setAllPurposes = function (mode) { + if(isConsentv2()){ + return dataLayer.utils.setConsent(mode); + } + }; + this.setByPurpose = function (purpose, mode, products) { + if(isConsentv2()){ + dataLayer.utils.setConsent(purpose, mode, products); + } + }; + this.getByPurpose = function () { + return dataLayer.utils.getConsent(); + }; /* internal use */ this.getModeMetadata = function () { @@ -136,7 +152,6 @@ function DlPrivacy(pa) { } } }; - this.setItem = function (key, value, expiration, callback) { if (this.isKeyAllowed(key)) { pa._storage.setItem(key, value, expiration, callback); diff --git a/src/config.js b/src/config.js index 57e9e4d..8efba1c 100644 --- a/src/config.js +++ b/src/config.js @@ -23,7 +23,7 @@ export default { ], 'storageVisitor': 'pa_vid', 'storageUser': 'pa_user', - 'version': '6.13.1', + 'version': '6.14.0', 'minHeartbeat': 5, 'minBufferingHeartbeat': 1, 'queueVarName': '_paq', diff --git a/src/core/PianoAnalytics.js b/src/core/PianoAnalytics.js index c699d69..34f67dd 100644 --- a/src/core/PianoAnalytics.js +++ b/src/core/PianoAnalytics.js @@ -124,7 +124,7 @@ function _sendEvent(events, options) { } events[i] = eventFormatted; } - const data = {events: events, options: options}; + const data = {events: cloneObject(events), options: cloneObject(options)}; if (steps.length > 0 && typeof steps[0] === 'function') { const clonedConfig = new Configuration(this.cfg.cloneData()); steps[0](this, new Model(this, data, clonedConfig), steps.slice(1)); diff --git a/src/core/model.js b/src/core/model.js index 92d2c3f..af19492 100644 --- a/src/core/model.js +++ b/src/core/model.js @@ -2,14 +2,16 @@ import {cloneObject} from '../utils/index'; function Model(pa, data, config) { this.properties = cloneObject(pa._properties); - this.setProperty = function (name, value, options) { + this.addEventsProperty = function (name, value) { if (pa._privacy.call('isPropAllowed', name)) { - this.properties[name] = { - value: value, - options: options || {} - }; + for (const event of this.events) { + if (this.isPropertyAbsentForEvent(name, event)) { + event.data[name] = value; + } + } } }; + this.hasProperty = function (name) { return Object.prototype.hasOwnProperty.call(this.properties, name); }; @@ -22,6 +24,26 @@ function Model(pa, data, config) { data: {} }; this.events = data.events || []; + this.isPropertyAbsentForEvent = function (name, event) { + if (typeof event.data[name] !== 'undefined') { + return false; + } else if (this.hasProperty(name)) { + if (typeof this.properties[name].options.events !== 'undefined') { + const propertyEventsOption = this.properties[name].options.events; + for (const eventAllowed of propertyEventsOption) { + if ( + event.name === eventAllowed || + (eventAllowed.charAt(eventAllowed.length - 1) === '*' && event.name.indexOf(eventAllowed.substring(0, eventAllowed.length - 1)) === 0) + ) { + return false; + } + } + } else { + return false; + } + } + return true; + }; } export default Model; diff --git a/src/core/steps/campaigns.step.js b/src/core/steps/campaigns.step.js index cbba1a3..f03b3d3 100644 --- a/src/core/steps/campaigns.step.js +++ b/src/core/steps/campaigns.step.js @@ -18,7 +18,7 @@ function _addCampaignParams(pa, model, href, prefix, destPrefix) { let found = false; for (const param in campaignParams) { if (Object.prototype.hasOwnProperty.call(campaignParams, param) && !model.properties[param]) { - model.setProperty(param, campaignParams[param], {persistent: true}); + model.addEventsProperty(param, campaignParams[param], {persistent: true}); } found = true; } diff --git a/src/core/steps/metadata.step.js b/src/core/steps/metadata.step.js index 753ab7d..cbb89b8 100644 --- a/src/core/steps/metadata.step.js +++ b/src/core/steps/metadata.step.js @@ -18,12 +18,12 @@ function _camelToSnake(string) { } function metadataStep(pa, model, nextSteps) { - model.setProperty('event_collection_platform', BUILD_BROWSER ? 'js' : 'js-browserless'); - model.setProperty('event_collection_version', model.getConfiguration('version')); + model.addEventsProperty('event_collection_platform', BUILD_BROWSER ? 'js' : 'js-browserless'); + model.addEventsProperty('event_collection_version', model.getConfiguration('version')); const date = new Date(); - model.setProperty('device_timestamp_utc', date.getTime()); - model.setProperty('device_local_hour', date.getTime()); - model.setProperty('device_hour', date.getHours()); + model.addEventsProperty('device_timestamp_utc', date.getTime()); + model.addEventsProperty('device_local_hour', date.getTime()); + model.addEventsProperty('device_hour', date.getHours()); if (BUILD_BROWSER) { const manualConfig = 'isManualPageRefresh', @@ -43,20 +43,14 @@ function metadataStep(pa, model, nextSteps) { } } - if (_isPropertiesAbsentForEvent(pageviewidProp, model, event)) { - if (pa._privacy.call('isPropAllowed', pageviewidProp)) { - event.data[pageviewidProp] = dataLayer.get('pageViewId'); - } + if (pa._privacy.call('isPropAllowed', pageviewidProp) && model.isPropertyAbsentForEvent(pageviewidProp, event)) { + event.data[pageviewidProp] = dataLayer.get('pageViewId'); } } try { const cookieCreationDate = new Date((new Date(dataLayer.cookies._pcid.fixedAt[0])).setUTCHours(0, 0, 0, 0)).toISOString(); - for (const event of model.events) { - if (_isPropertiesAbsentForEvent('cookie_creation_date', model, event)) { - model.setProperty('cookie_creation_date', cookieCreationDate); - } - } + model.addEventsProperty('cookie_creation_date', cookieCreationDate); } catch (e) { /* empty */ } const content = dataLayer.get('content'); @@ -67,40 +61,34 @@ function metadataStep(pa, model, nextSteps) { 'tags': 'tags_array' }; const propFinalName = (propContent === 'createdAt' || propContent === 'tags') ? MAP_PA_DL[propContent] : _camelToSnake(`content_${propContent}`); - for (const event of model.events) { - if (_isPropertiesAbsentForEvent(propFinalName, model, event)) { - if (pa._privacy.call('isPropAllowed', propFinalName)) { - event.data[propFinalName] = content[propContent]; - } - } - } + model.addEventsProperty(propFinalName, content[propContent]); } } - model.setProperty('has_access', dataLayer.get('userStatus')); - model.setProperty('device_screen_width', window.screen.width); - model.setProperty('device_screen_height', window.screen.height); - model.setProperty('device_display_width', + model.addEventsProperty('has_access', dataLayer.get('userStatus')); + model.addEventsProperty('device_screen_width', window.screen.width); + model.addEventsProperty('device_screen_height', window.screen.height); + model.addEventsProperty('device_display_width', window.innerWidth || document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : '' ); - model.setProperty('device_display_height', + model.addEventsProperty('device_display_height', window.innerHeight || document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : '' ); const language = window.navigator ? (window.navigator.language || window.navigator.userLanguage) : ''; const languageSplitted = _parseLanguage(language, ['-', '_']); - model.setProperty('browser_language', languageSplitted[0]); - model.setProperty('browser_language_local', languageSplitted[1]); - model.setProperty('previous_url', document.referrer || ''); + model.addEventsProperty('browser_language', languageSplitted[0]); + model.addEventsProperty('browser_language_local', languageSplitted[1]); + model.addEventsProperty('previous_url', document.referrer || ''); if (document.title) { - model.setProperty('page_title_html', document.title); + model.addEventsProperty('page_title_html', document.title); } const eventUrlWithQueryString = model.getConfiguration('addEventURL').toString() === 'true'; if (eventUrlWithQueryString || (model.getConfiguration('addEventURL') === 'withoutQS')) { - model.setProperty('event_url_full', eventUrlWithQueryString ? window.location.href.split('#')[0] : `${window.location.protocol}//${window.location.host}${window.location.pathname}`); + model.addEventsProperty('event_url_full', eventUrlWithQueryString ? window.location.href.split('#')[0] : `${window.location.protocol}//${window.location.host}${window.location.pathname}`); } try { @@ -139,21 +127,6 @@ function metadataStep(pa, model, nextSteps) { } } -function _isPropertiesAbsentForEvent(name, model, event) { - if (model.hasProperty(name) && model.properties[name].options.events) { - const propertyEventsOption = model.properties[name].options.events; - if (propertyEventsOption.indexOf(event.name) > -1) { - return false; - } - for (const eventAllowed of propertyEventsOption) { - if (eventAllowed.charAt(eventAllowed.length - 1) === '*' && event.name.indexOf(eventAllowed.substring(0, eventAllowed.length - 1)) === 0) { - return false; - } - } - } - return typeof event.data[name] === 'undefined'; -} - function _isDefined(variable) { return typeof variable !== 'undefined'; } @@ -200,7 +173,7 @@ function _addUserAgentMetadata(model, ua) { if (_isDefined(ua)) { for (let i = 0; i < properties.length; i++) { if (_isDefined(ua[properties[i].metric])) { - model.setProperty(properties[i].property, ua[properties[i].metric]); + model.addEventsProperty(properties[i].property, ua[properties[i].metric]); } } } diff --git a/src/core/steps/privacy.step.js b/src/core/steps/privacy.step.js index eb99974..aa1b295 100644 --- a/src/core/steps/privacy.step.js +++ b/src/core/steps/privacy.step.js @@ -9,7 +9,7 @@ function privacyStep(pa, model, nextSteps) { let metadata = pa._privacy.call('getModeMetadata') || {}; for (const property in metadata) { if (Object.prototype.hasOwnProperty.call(metadata, property)) { - model.setProperty(property, metadata[property]); + model.addEventsProperty(property, metadata[property]); } } } diff --git a/src/core/steps/properties.step.js b/src/core/steps/properties.step.js index f579ff7..e92a67b 100644 --- a/src/core/steps/properties.step.js +++ b/src/core/steps/properties.step.js @@ -22,7 +22,7 @@ function propertiesStep(pa, model, nextSteps) { } else if (!propertyEventsOption) { isEventOptionOk = true; } - if (isEventOptionOk) { + if (isEventOptionOk && typeof event.data[property] === 'undefined') { event.data[property] = model.properties[property].value; isAdded = true; } diff --git a/src/core/steps/user.step.js b/src/core/steps/user.step.js index dd20cda..27a366f 100644 --- a/src/core/steps/user.step.js +++ b/src/core/steps/user.step.js @@ -9,9 +9,9 @@ function userStep(pa, model, nextSteps) { const opts = { persistent: true }; - model.setProperty('user_id', userStored.id, opts); - model.setProperty('user_category', userStored.category, opts); - model.setProperty('user_recognition', true, opts); + model.addEventsProperty('user_id', userStored.id, opts); + model.addEventsProperty('user_category', userStored.category, opts); + model.addEventsProperty('user_recognition', true, opts); } nextStep(pa, model, nextSteps); }); diff --git a/test/browser/privacy.js b/test/browser/privacy.js index b7c1f3e..87a1524 100644 --- a/test/browser/privacy.js +++ b/test/browser/privacy.js @@ -336,7 +336,12 @@ describe('Privacy in Browser :', function () { 'previous_url', 'ch_ua', 'ch_ua_mobile', + 'ch_ua_arch', + 'ch_ua_bitness', + 'ch_ua_full_version', 'ch_ua_full_version_list', + 'ch_ua_platform', + 'ch_ua_platform_version', 'cookie_creation_date' ] ); @@ -349,14 +354,14 @@ describe('Privacy in Browser :', function () { 'has_access': 'forced_value_for_test', 'pageview_id': 'forced_value_for_test', 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'custom.allisgreen': 'custom.allisgreen', 'customprop1_sub1': '11', @@ -396,14 +401,14 @@ describe('Privacy in Browser :', function () { 'has_access': 'forced_value_for_test', 'pageview_id': 'forced_value_for_test', 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'click': 'click navigation', 'click_chapter1': 'click chapter 1', @@ -464,14 +469,14 @@ describe('Privacy in Browser :', function () { 'has_access': 'forced_value_for_test', 'pageview_id': 'forced_value_for_test', 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1': '11', 'customprop1_sub1_deep2': '112', @@ -565,8 +570,13 @@ describe('Privacy in Browser :', function () { 'event_collection_platform', 'event_collection_version', 'ch_ua', - 'ch_ua_full_version_list', 'ch_ua_mobile', + 'ch_ua_arch', + 'ch_ua_bitness', + 'ch_ua_full_version', + 'ch_ua_full_version_list', + 'ch_ua_platform', + 'ch_ua_platform_version' ] ); expect(model.build.data).to.deep.equal({ @@ -574,14 +584,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', 'customprop2_sub1': '21', @@ -608,14 +618,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', 'customprop2_sub1': '21', @@ -642,14 +652,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', 'customprop2_sub1': '21', @@ -676,14 +686,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', 'customprop2_sub1': '21', @@ -710,14 +720,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'device_timestamp_utc': 'forced_value_for_test', 'event_collection_platform': 'forced_value_for_test', 'event_collection_version': 'forced_value_for_test', @@ -730,14 +740,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'device_timestamp_utc': 'forced_value_for_test', 'event_collection_platform': 'forced_value_for_test', 'event_collection_version': 'forced_value_for_test', @@ -750,14 +760,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', 'customprop2_sub1': '21', @@ -836,8 +846,13 @@ describe('Privacy in Browser :', function () { 'event_collection_platform', 'event_collection_version', 'ch_ua', - 'ch_ua_full_version_list', 'ch_ua_mobile', + 'ch_ua_arch', + 'ch_ua_bitness', + 'ch_ua_full_version', + 'ch_ua_full_version_list', + 'ch_ua_platform', + 'ch_ua_platform_version' ] ); @@ -846,14 +861,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', 'customprop2_sub1': '21', @@ -880,14 +895,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', 'customprop2_sub1': '21', @@ -914,14 +929,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', 'customprop2_sub1': '21', @@ -948,14 +963,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', 'customprop2_sub1': '21', @@ -982,14 +997,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'device_timestamp_utc': 'forced_value_for_test', 'event_collection_platform': 'forced_value_for_test', 'event_collection_version': 'forced_value_for_test', @@ -1002,14 +1017,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'device_timestamp_utc': 'forced_value_for_test', 'event_collection_platform': 'forced_value_for_test', 'event_collection_version': 'forced_value_for_test', @@ -1022,14 +1037,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', 'customprop2_sub1': '21', @@ -1111,8 +1126,13 @@ describe('Privacy in Browser :', function () { 'event_collection_platform', 'event_collection_version', 'ch_ua', - 'ch_ua_full_version_list', 'ch_ua_mobile', + 'ch_ua_arch', + 'ch_ua_bitness', + 'ch_ua_full_version', + 'ch_ua_full_version_list', + 'ch_ua_platform', + 'ch_ua_platform_version', 'cookie_creation_date', 'previous_url', 'event_url_full' @@ -1174,14 +1194,14 @@ describe('Privacy in Browser :', function () { 'previous_url': 'forced_value_for_test', 'event_url_full': 'forced_value_for_test', 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', } }, @@ -1238,14 +1258,14 @@ describe('Privacy in Browser :', function () { 'previous_url': 'forced_value_for_test', 'event_url_full': 'forced_value_for_test', 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', } }, @@ -1302,14 +1322,14 @@ describe('Privacy in Browser :', function () { 'previous_url': 'forced_value_for_test', 'event_url_full': 'forced_value_for_test', 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', } }, @@ -1366,14 +1386,14 @@ describe('Privacy in Browser :', function () { 'previous_url': 'forced_value_for_test', 'event_url_full': 'forced_value_for_test', 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', } }, @@ -1437,14 +1457,14 @@ describe('Privacy in Browser :', function () { 'previous_url': 'forced_value_for_test', 'event_url_full': 'forced_value_for_test', 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', } }, @@ -1508,14 +1528,14 @@ describe('Privacy in Browser :', function () { 'previous_url': 'forced_value_for_test', 'event_url_full': 'forced_value_for_test', 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', } }, @@ -1575,14 +1595,14 @@ describe('Privacy in Browser :', function () { 'previous_url': 'forced_value_for_test', 'event_url_full': 'forced_value_for_test', 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', } } @@ -1643,8 +1663,13 @@ describe('Privacy in Browser :', function () { 'event_collection_platform', 'event_collection_version', 'ch_ua', - 'ch_ua_full_version_list', 'ch_ua_mobile', + 'ch_ua_arch', + 'ch_ua_bitness', + 'ch_ua_full_version', + 'ch_ua_full_version_list', + 'ch_ua_platform', + 'ch_ua_platform_version', 'cookie_creation_date', 'pageview_id', 'previous_url', @@ -1657,14 +1682,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -1699,14 +1724,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -1741,14 +1766,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -1783,14 +1808,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'click': 'click exit', 'click_chapter1': 'click chapter 1', @@ -1819,14 +1844,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'click': 'click navigation', 'click_chapter1': 'click chapter 1', @@ -1855,14 +1880,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -1955,8 +1980,13 @@ describe('Privacy in Browser :', function () { 'event_collection_platform', 'event_collection_version', 'ch_ua', - 'ch_ua_full_version_list', 'ch_ua_mobile', + 'ch_ua_arch', + 'ch_ua_bitness', + 'ch_ua_full_version', + 'ch_ua_full_version_list', + 'ch_ua_platform', + 'ch_ua_platform_version', 'cookie_creation_date', 'event_url_full', 'pageview_id', @@ -1969,14 +1999,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -2011,14 +2041,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -2053,14 +2083,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -2095,14 +2125,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'click': 'click exit', 'click_chapter1': 'click chapter 1', @@ -2131,14 +2161,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'click': 'click navigation', 'click_chapter1': 'click chapter 1', @@ -2167,14 +2197,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -2273,8 +2303,13 @@ describe('Privacy in Browser :', function () { 'event_collection_platform', 'event_collection_version', 'ch_ua', - 'ch_ua_full_version_list', 'ch_ua_mobile', + 'ch_ua_arch', + 'ch_ua_bitness', + 'ch_ua_full_version', + 'ch_ua_full_version_list', + 'ch_ua_platform', + 'ch_ua_platform_version', 'cookie_creation_date', 'event_url_full', 'pageview_id', @@ -2287,14 +2322,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -2329,14 +2364,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -2371,14 +2406,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', @@ -2413,14 +2448,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'click': 'click exit', 'click_chapter1': 'click chapter 1', @@ -2449,14 +2484,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'click': 'click navigation', 'click_chapter1': 'click chapter 1', 'click_chapter2': 'click chapter 2', @@ -2485,14 +2520,14 @@ describe('Privacy in Browser :', function () { { 'data': { 'ch_ua': 'forced_value_for_test', - "ch_ua_arch": "", - "ch_ua_bitness": "", - "ch_ua_full_version": "", + 'ch_ua_arch': 'forced_value_for_test', + 'ch_ua_bitness': 'forced_value_for_test', + 'ch_ua_full_version': 'forced_value_for_test', 'ch_ua_full_version_list': 'forced_value_for_test', 'ch_ua_mobile': 'forced_value_for_test', - "ch_ua_model": "", - "ch_ua_platform": "", - "ch_ua_platform_version": "", + 'ch_ua_model': '', + 'ch_ua_platform': 'forced_value_for_test', + 'ch_ua_platform_version': 'forced_value_for_test', 'cookie_creation_date': 'forced_value_for_test', 'customprop1_sub1_deep1': '111', 'customprop1_sub2_deep2': '122', diff --git a/test/shared/properties.js b/test/shared/properties.js index 9659d91..23900a4 100644 --- a/test/shared/properties.js +++ b/test/shared/properties.js @@ -188,28 +188,32 @@ describe('Properties :', function () { }); }); it('Should not override values of privacy specific properties', function (done) { - globalPA.setProperty('visitor_privacy_consent', false); - globalPA.sendEvent('toto', {}, { + globalPA.setProperty('visitor_privacy_consent', 'myconsent'); + globalPA.setProperty('visitor_privacy_mode', 'test'); + globalPA.sendEvent('toto', {'visitor_privacy_mode': 'mymode'}, { onBeforeSend: function (pianoanalytics, model) { - expect(model.build.data.events[0].data['visitor_privacy_consent']).to.equal(true); - expect(model.build.data.events[0].data['visitor_privacy_mode']).to.equal('optin'); - done(); + Utility.promiseThrowCatcher(done, function () { + expect(model.build.data.events[0].data['visitor_privacy_consent']).to.equal('myconsent'); + expect(model.build.data.events[0].data['visitor_privacy_mode']).to.equal('mymode'); + done(); + }); } }); }); it('Should not override values of metadata specific properties', function (done) { globalPA.setProperty('event_collection_platform', '1'); - globalPA.setProperty('event_collection_version', '2'); - globalPA.setProperty('device_timestamp_utc', '3'); - globalPA.sendEvent('toto', {}, { + globalPA.setProperty('event_collection_version', '22'); + globalPA.sendEvent('toto', { + 'event_collection_version': '2', + 'device_timestamp_utc': '3' + }, { onBeforeSend: function (pianoanalytics, model) { - expect(model.build.data.events[0].data['event_collection_platform']).to.not.equal('1'); - expect(model.build.data.events[0].data['event_collection_platform']).to.not.equal(undefined); - expect(model.build.data.events[0].data['event_collection_version']).to.not.equal('2'); - expect(model.build.data.events[0].data['event_collection_version']).to.not.equal(undefined); - expect(model.build.data.events[0].data['device_timestamp_utc']).to.not.equal('3'); - expect(model.build.data.events[0].data['device_timestamp_utc']).to.not.equal(undefined); - done(); + Utility.promiseThrowCatcher(done, function () { + expect(model.build.data.events[0].data['event_collection_platform']).to.equal('1'); + expect(model.build.data.events[0].data['event_collection_version']).to.equal('2'); + expect(model.build.data.events[0].data['device_timestamp_utc']).to.equal('3'); + done(); + }); } }); }); @@ -437,32 +441,40 @@ describe('Properties :', function () { }); it('Should not override values of privacy specific properties', function (done) { globalPA.setProperties({ - 'visitor_privacy_consent': false, + 'visitor_privacy_consent': 'myconsent', 'visitor_privacy_mode': 'test' }); - globalPA.sendEvent('toto', {}, { + globalPA.sendEvent('toto', {'visitor_privacy_mode': 'mymode'}, { onBeforeSend: function (pianoanalytics, model) { - expect(model.build.data.events[0].data['visitor_privacy_consent']).to.equal(true); - expect(model.build.data.events[0].data['visitor_privacy_mode']).to.equal('optin'); - done(); + Utility.promiseThrowCatcher(done, function () { + expect(model.build.data.events[0].data['visitor_privacy_consent']).to.equal('myconsent'); + expect(model.build.data.events[0].data['visitor_privacy_mode']).to.equal('mymode'); + done(); + }); } }); }); it('Should not override values of metadata specific properties', function (done) { globalPA.setProperties({ 'event_collection_platform': '1', + }, {events: ['tata']}); + globalPA.setProperties({ 'event_collection_version': '2', - 'device_timestamp_utc': '3' - }); - globalPA.sendEvent('toto', {}, { + 'device_timestamp_utc': 'test' + }, {events: ['toto']}); + globalPA.setProperties({ + 'device_local_hour': '4' + }, {events: ['to*']}); + globalPA.sendEvent('toto', {'device_timestamp_utc': '3'}, { onBeforeSend: function (pianoanalytics, model) { - expect(model.build.data.events[0].data['event_collection_platform']).to.not.equal('1'); - expect(model.build.data.events[0].data['event_collection_platform']).to.not.equal(undefined); - expect(model.build.data.events[0].data['event_collection_version']).to.not.equal('2'); - expect(model.build.data.events[0].data['event_collection_version']).to.not.equal(undefined); - expect(model.build.data.events[0].data['device_timestamp_utc']).to.not.equal('3'); - expect(model.build.data.events[0].data['device_timestamp_utc']).to.not.equal(undefined); - done(); + Utility.promiseThrowCatcher(done, function () { + expect(model.build.data.events[0].data['event_collection_platform']).to.not.equal('1'); + expect(model.build.data.events[0].data['event_collection_platform']).to.not.equal(undefined); + expect(model.build.data.events[0].data['event_collection_version']).to.equal('2'); + expect(model.build.data.events[0].data['device_timestamp_utc']).to.equal('3'); + expect(model.build.data.events[0].data['device_local_hour']).to.equal('4'); + done(); + }); } }); });