@mparticle/web-adwords-kit 2.3.1 → 2.3.2
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.
|
@@ -85,24 +85,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
85
85
|
// If consent payload is empty,
|
|
86
86
|
// we never sent an initial default consent state
|
|
87
87
|
// so we shouldn't send an update.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (!isEmpty(eventConsentState)) {
|
|
92
|
-
var updatedConsentPayload = generateConsentStatePayloadFromMappings(
|
|
93
|
-
eventConsentState,
|
|
94
|
-
consentMappings,
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
var eventConsentAsString =
|
|
98
|
-
JSON.stringify(updatedConsentPayload);
|
|
99
|
-
|
|
100
|
-
if (eventConsentAsString !== consentPayloadAsString) {
|
|
101
|
-
sendGtagConsentUpdate(updatedConsentPayload);
|
|
102
|
-
consentPayloadAsString = eventConsentAsString;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
88
|
+
var eventConsentState = getEventConsentState(event.ConsentState);
|
|
89
|
+
maybeSendConsentUpdateToGoogle(eventConsentState);
|
|
106
90
|
|
|
107
91
|
if (
|
|
108
92
|
forwarderSettings.enableEnhancedConversions ===
|
|
@@ -359,8 +343,33 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
359
343
|
return true;
|
|
360
344
|
}
|
|
361
345
|
|
|
346
|
+
function maybeSendConsentUpdateToGoogle(consentState) {
|
|
347
|
+
if (
|
|
348
|
+
consentPayloadAsString &&
|
|
349
|
+
forwarderSettings.consentMappingWeb &&
|
|
350
|
+
!isEmpty(consentState)
|
|
351
|
+
) {
|
|
352
|
+
var updatedConsentPayload = generateConsentStatePayloadFromMappings(
|
|
353
|
+
consentState,
|
|
354
|
+
consentMappings,
|
|
355
|
+
);
|
|
356
|
+
|
|
357
|
+
var eventConsentAsString =
|
|
358
|
+
JSON.stringify(updatedConsentPayload);
|
|
359
|
+
|
|
360
|
+
if (eventConsentAsString !== consentPayloadAsString) {
|
|
361
|
+
sendGtagConsentUpdate(updatedConsentPayload);
|
|
362
|
+
consentPayloadAsString = eventConsentAsString;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
362
367
|
function sendGtagConsentDefaults(payload) {
|
|
363
368
|
// https://go.mparticle.com/work/SQDSDKS-6165
|
|
369
|
+
consentPayloadAsString = JSON.stringify(
|
|
370
|
+
payload
|
|
371
|
+
);
|
|
372
|
+
|
|
364
373
|
try {
|
|
365
374
|
gtag('consent', 'default', payload);
|
|
366
375
|
} catch (e) {
|
|
@@ -557,21 +566,22 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
557
566
|
}
|
|
558
567
|
|
|
559
568
|
consentPayloadDefaults = getConsentSettings();
|
|
560
|
-
var
|
|
561
|
-
|
|
562
|
-
var
|
|
569
|
+
var defaultConsentPayload = cloneObject(consentPayloadDefaults);
|
|
570
|
+
var updatedConsentState = getUserConsentState();
|
|
571
|
+
var updatedDefaultConsentPayload =
|
|
563
572
|
generateConsentStatePayloadFromMappings(
|
|
564
|
-
|
|
573
|
+
updatedConsentState,
|
|
565
574
|
consentMappings
|
|
566
575
|
);
|
|
567
576
|
|
|
568
|
-
if(!isEmpty(defaultConsentPayload)) {
|
|
569
|
-
consentPayloadAsString = JSON.stringify(
|
|
570
|
-
defaultConsentPayload
|
|
571
|
-
);
|
|
572
|
-
|
|
577
|
+
if (!isEmpty(defaultConsentPayload)) {
|
|
573
578
|
sendGtagConsentDefaults(defaultConsentPayload);
|
|
579
|
+
} else if (!isEmpty(updatedDefaultConsentPayload)) {
|
|
580
|
+
sendGtagConsentDefaults(updatedDefaultConsentPayload);
|
|
574
581
|
}
|
|
582
|
+
|
|
583
|
+
maybeSendConsentUpdateToGoogle(updatedConsentState);
|
|
584
|
+
|
|
575
585
|
}
|
|
576
586
|
|
|
577
587
|
forwarderSettings.remarketingOnly = forwarderSettings.remarketingOnly == 'True';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mparticle/web-adwords-kit",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"author": "mParticle Developers <developers@mparticle.com> (https://www.mparticle.com)",
|
|
5
5
|
"description": "mParticle integration sdk for Google Adwords",
|
|
6
6
|
"main": "dist/GoogleAdWordsEventForwarder.common.js",
|