Skip to content

Commit

Permalink
Merge pull request #16 from stape-io/update-tpl-with-user_data-hashing
Browse files Browse the repository at this point in the history
Update .tpl with user_data hashing fix
  • Loading branch information
Bukashk0zzz authored Jul 5, 2024
2 parents 36519e1 + a3c841a commit 104ce24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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;
}
});
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 104ce24

Please sign in to comment.