@mparticle/web-onetrust-kit 3.21.0 → 3.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,16 @@ var CONSENT_REGULATIONS = {
7
7
  };
8
8
  var CCPA_PURPOSE = 'data_sale_opt_out';
9
9
 
10
+ // The consent record keeps where consent was given, not the query or fragment.
11
+ // Uses the core SDK's rule when it has one (mParticle._cleanUrl).
12
+ function getConsentLocation() {
13
+ var href = window.location.href;
14
+ if (window.mParticle && typeof window.mParticle._cleanUrl === 'function') {
15
+ return window.mParticle._cleanUrl(href, 'path');
16
+ }
17
+ return href.split(/[?#]/)[0];
18
+ }
19
+
10
20
  var initialization = {
11
21
  name: 'OneTrust',
12
22
  moduleId: 134,
@@ -80,7 +90,7 @@ var initialization = {
80
90
  return;
81
91
  }
82
92
 
83
- var location = window.location.href;
93
+ var location = getConsentLocation();
84
94
  var consentState =
85
95
  user.getConsentState() || mParticle.Consent.createConsentState();
86
96
 
@@ -151,7 +161,7 @@ var initialization = {
151
161
  createVendorConsentEvents: function() {
152
162
  var self = this;
153
163
  if (window.OneTrust && window.OneTrust.getVendorConsentsRequestV2) {
154
- var location = window.location.href,
164
+ var location = getConsentLocation(),
155
165
  consentState,
156
166
  user = mParticle.Identity.getCurrentUser();
157
167
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mparticle/web-onetrust-kit",
3
- "version": "3.21.0",
3
+ "version": "3.23.0",
4
4
  "author": "mParticle Developers <developers@mparticle.com> (https://www.mparticle.com)",
5
5
  "description": "mParticle integration sdk for OneTrust",
6
6
  "browser": "dist/OneTrustKit.common.js",