Skip to content

Commit

Permalink
6.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
piano-analytics committed May 25, 2023
1 parent 60ab13e commit 412fd92
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 48 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 6.9.1
### Changes
- Event URL is now sent in property `event_url_full` instead of `page_url`
### Fixes
- Privacy rules were not applied properly to content properties in version 6.9.0


## 6.9.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.9.0",
"version": "6.10.0",
"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.9.0',
'version': '6.10.0',
'minHeartbeat': 5,
'minBufferingHeartbeat': 1,
'queueVarName': '_paq',
Expand Down
4 changes: 2 additions & 2 deletions src/core/steps/metadata.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function metadataStep(pa, model, nextSteps) {
}
const isAlreadyInEvent = typeof event.data[propFinalName] !== 'undefined';
if (!isAlreadyInProperties && !isAlreadyInEvent) {
if (pa._privacy.call('isPropAllowed', name)) {
if (pa._privacy.call('isPropAllowed', propFinalName)) {
event.data[propFinalName] = content[propContent];
}
}
Expand Down Expand Up @@ -87,7 +87,7 @@ function metadataStep(pa, model, nextSteps) {
}
const eventUrlWithQueryString = model.getConfiguration('addEventURL').toString() === 'true';
if (eventUrlWithQueryString || (model.getConfiguration('addEventURL') === 'withoutQS')) {
model.setProperty('page_url', eventUrlWithQueryString ? window.location.href.split('#')[0] : `${window.location.protocol}//${window.location.host}${window.location.pathname}`);
model.setProperty('event_url_full', eventUrlWithQueryString ? window.location.href.split('#')[0] : `${window.location.protocol}//${window.location.host}${window.location.pathname}`);
}

try {
Expand Down
8 changes: 4 additions & 4 deletions test/browser/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ describe('Metadata in browser :', function () {
}
});
});
it('Should add page_url', function (done) {
it('Should add event_url_full', function (done) {
globalPA.sendEvent('toto', {test: 'test'}, {
onBeforeSend: function (pianoanalytics, model) {
Utility.promiseThrowCatcher(done, function () {
expect(model.build.data.events[0].data['page_url']).to.not.equal(undefined);
expect(typeof model.build.data.events[0].data['page_url']).to.equal('string');
expect(typeof model.build.data.events[0].data['page_url']).to.not.equal('');
expect(model.build.data.events[0].data['event_url_full']).to.not.equal(undefined);
expect(typeof model.build.data.events[0].data['event_url_full']).to.equal('string');
expect(typeof model.build.data.events[0].data['event_url_full']).to.not.equal('');
done();
});
}
Expand Down
81 changes: 43 additions & 38 deletions test/browser/privacy.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions test/node/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ describe('Metadata not in browser :', function () {
}
});
});
it('Should not add page_url', function (done) {
it('Should not add event_url_full', function (done) {
globalPA.sendEvent('toto', {test: 'test'}, {
onBeforeSend: function (pianoanalytics, model) {
expect(model.build.data.events[0].data['page_url']).to.equal(undefined);
expect(model.build.data.events[0].data['event_url_full']).to.equal(undefined);
done();
}
});
Expand Down

0 comments on commit 412fd92

Please sign in to comment.