Skip to content

Commit

Permalink
6.15.2
Browse files Browse the repository at this point in the history
  • Loading branch information
piano-analytics committed Oct 11, 2024
1 parent a3eb8aa commit 8e254c0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## 6.15.2
### Fixes
- Fix the configuration `sendEventWhenOptout` (broken in versions 6.15.0 and 6.15.1)

## 6.15.1
### Fixes
- [browser] Fix a specific case when consent is disabled
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.15.1",
"version": "6.15.2",
"main": "dist/browserless/piano-analytics.cjs.js",
"module": "dist/browserless/piano-analytics.esm.js",
"browser": "dist/browser/piano-analytics.umd.js",
Expand Down
6 changes: 2 additions & 4 deletions src/business/privacy/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import {dataLayer} from '../ext/data-layer/data-layer';

function Privacy(pa) {
this.isLegacyPrivacy = true;
this.modeEnum = {
OPTOUT: (() => {
return this.isLegacyPrivacy ? 'optout' : 'opt-out';
})()
this.getOptoutValue = function () {
return this.isLegacyPrivacy ? 'optout' : 'opt-out';
};
this.call = function (method, ...paramsArray) {
const privacy = this.isLegacyPrivacy ? 'privacy' : 'consent';
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.15.1',
'version': '6.15.2',
'minHeartbeat': 5,
'minBufferingHeartbeat': 1,
'queueVarName': '_paq',
Expand Down
4 changes: 2 additions & 2 deletions src/core/steps/send.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {nextStep} from './utils/index';
import {http} from '../../utils/index';

function sendStep(pa, model, nextSteps) {
if ((pa._privacy.call('getMode') !== pa._privacy.modeEnum.OPTOUT ||
(pa._privacy.call('getMode') === pa._privacy.modeEnum.OPTOUT && model.getConfiguration('sendEventWhenOptout'))
if ((pa._privacy.call('getMode') !== pa._privacy.getOptoutValue() ||
(pa._privacy.call('getMode') === pa._privacy.getOptoutValue() && model.getConfiguration('sendEventWhenOptout'))
) && model.build.data.events.length > 0) {
http.post(model.build.url, JSON.stringify(model.build.data));
}
Expand Down

0 comments on commit 8e254c0

Please sign in to comment.