Skip to content

Commit

Permalink
Address PR Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexs-mparticle committed Feb 22, 2024
1 parent c5dc15f commit 2202dd9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/GoogleAdWordsEventForwarder.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
// Server Integration uses 'Unspecified' as a value when the setting is 'not set'.
// However, this is not used by Google's Web SDK. We are referencing it here as a comment
// as a record of this distinction and for posterity.
// If Google ever adds this for web, the line can just be uncommented to support this.
//
// Docs:
// Web: https://developers.google.com/tag-platform/gtagjs/reference#consent
Expand Down Expand Up @@ -93,15 +94,14 @@
var updatedConsentPayload = generateConsentStatePayloadFromMappings(
eventConsentState,
consentMappings,
consentPayloadDefaults,
);

var eventPayloadAsString =
var eventConsentAsString =
JSON.stringify(updatedConsentPayload);

if (eventPayloadAsString !== consentPayloadAsString) {
if (eventConsentAsString !== consentPayloadAsString) {
sendGtagConsentUpdate(updatedConsentPayload);
consentPayloadAsString = eventPayloadAsString;
consentPayloadAsString = eventConsentAsString;
}
}

Expand Down Expand Up @@ -396,7 +396,7 @@

if (
consentState[mpMappedConsentName] &&
googleConsentProperties.includes(googleMappedConsentName)
googleConsentProperties.indexOf(googleMappedConsentName) !== -1
) {
payload[googleMappedConsentName] = consentState[mpMappedConsentName]
.Consented
Expand Down Expand Up @@ -549,7 +549,6 @@
generateConsentStatePayloadFromMappings(
initialConsentState,
consentMappings,
consentPayloadDefaults,
);
consentPayloadAsString = JSON.stringify(defaultConsentPayload);

Expand Down

0 comments on commit 2202dd9

Please sign in to comment.