diff --git a/metadata.yaml b/metadata.yaml index 1c0d593..947e48b 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,5 +1,7 @@ homepage: "https://stape.io/" versions: + - sha: 606f02c9e2f6aeddeac547779ae7c13c39a3b24b + changeNotes: Update tpl with user_data hasing fix. - sha: 8671ef925695c8b4a9b7b992b7c7552a0d1b6b8c changeNotes: Override click id & userData hashing fix. - sha: 81fefccc9ebf0f95b71475cf07e65b45b7132879 diff --git a/template.tpl b/template.tpl index a02c8a1..aa99e80 100644 --- a/template.tpl +++ b/template.tpl @@ -673,7 +673,7 @@ if (url && url.lastIndexOf('https://gtm-msr.appspot.com/', 0) === 0) { } const pixelOrAppId = data.eventConversionType === 'MOBILE_APP' ? data.snapAppId : data.pixelId; -if(!pixelOrAppId || !data.accessToken) { +if (!pixelOrAppId || !data.accessToken) { return data.gtmOnFailure(); } @@ -883,7 +883,7 @@ function addCustomData(eventData, mappedData) { if (data.customDataList) { data.customDataList.forEach((d) => { - if(isValidValue(d.value)) { + if (isValidValue(d.value)) { mappedData.custom_data[d.name] = d.value; } }); @@ -981,7 +981,7 @@ function hashDataIfNeeded(mappedData) { const fieldsToHash = ['em', 'ph', 'fn', 'ln', 'ge', 'ct', 'st', 'zp', 'country', 'external_id']; for (let key in mappedData.user_data) { if (fieldsToHash.indexOf(key) !== -1) { - mappedData[key] = hashData(mappedData[key]); + mappedData.user_data[key] = hashData(mappedData.user_data[key]); } } return mappedData;