Skip to content

Commit

Permalink
6.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
piano-analytics committed Oct 24, 2023
1 parent 366994e commit 738e632
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Changelog
## 6.12.1
### Fixes
- [browser] Fix cookies expiration date being expanded when using consent without specifying storageMode
- [browser] Cookie `_pcus` being created by mistake

### Changes
- [browser] `cookie_creation_date` is now anonymized (time set to 0)

## 6.12.0

### New
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "piano-analytics-js",
"description": "JavaScript library for Piano Analytics",
"version": "6.12.0",
"version": "6.12.1",
"main": "dist/browserless/piano-analytics.cjs.js",
"module": "dist/browserless/piano-analytics.esm.js",
"browser": "dist/browser/piano-analytics.umd.js",
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
],
'storageVisitor': 'pa_vid',
'storageUser': 'pa_user',
'version': '6.12.0',
'version': '6.12.1',
'minHeartbeat': 5,
'minBufferingHeartbeat': 1,
'queueVarName': '_paq',
Expand Down
13 changes: 11 additions & 2 deletions src/core/PianoAnalytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,17 @@ function _initPrivacy(pa) {
storageMode: 'fixed'
}
};
} else if (window.pdl && window.pdl.requireConsent) {
pa.setConfiguration('isLegacyPrivacy', false);
} else {
if (window.pdl.requireConsent) {
pa.setConfiguration('isLegacyPrivacy', false);
}
if (typeof window.pdl.cookies === 'undefined') {
window.pdl.cookies = {
storageMode: 'fixed'
};
} else if (window.pdl.cookies && typeof window.pdl.cookies.storageMode === 'undefined') {
window.pdl.cookies.storageMode = 'fixed';
}
}
dataLayer.init({
cookieDefault: {
Expand Down
2 changes: 1 addition & 1 deletion src/core/steps/metadata.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function metadataStep(pa, model, nextSteps) {
}

try {
const cookieCreationDate = new Date(dataLayer.cookies._pcid.fixedAt[0]).toISOString();
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);
Expand Down

0 comments on commit 738e632

Please sign in to comment.