Skip to content

Commit

Permalink
cleanup dot in utm_sources (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
guitavano authored Jan 30, 2025
1 parent d38c500 commit 8a6ecae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion utils/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ export const removeScriptChars = (str: string): string => {
const removedPlus = str.replace(/\+/g, "").replaceAll(" ", "");
const removedBrackets = removedPlus.replace(/[\[\]{}()<>]/g, "");
const removedSlash = removedBrackets.replace(/[\/\\]/g, "");
const normalized = removedSlash.normalize("NFD").replace(
const removeDot = removedSlash.replace(/\./g, "");
const normalized = removeDot.normalize("NFD").replace(
/[\u0300-\u036f]/g,
"",
);
Expand Down
6 changes: 3 additions & 3 deletions vtex/utils/segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ const serialize = ({
priceTables,
regionId,
utm_campaign: utm_campaign &&
removeNonLatin1Chars(utm_campaign).replace(/[\/\[\]{}()<>]/g, ""),
removeNonLatin1Chars(utm_campaign).replace(/[\/\[\]{}()<>.]/g, ""),
utm_source: utm_source &&
removeNonLatin1Chars(utm_source).replace(/[\/\[\]{}()<>]/g, ""),
removeNonLatin1Chars(utm_source).replace(/[\/\[\]{}()<>.]/g, ""),
utm_medium: utm_medium &&
removeNonLatin1Chars(utm_medium).replace(/[\/\[\]{}()<>]/g, ""),
removeNonLatin1Chars(utm_medium).replace(/[\/\[\]{}()<>.]/g, ""),
utmi_campaign: utmi_campaign && removeNonLatin1Chars(utmi_campaign),
utmi_page: utmi_page && removeNonLatin1Chars(utmi_page),
utmi_part: utmi_part && removeNonLatin1Chars(utmi_part),
Expand Down

0 comments on commit 8a6ecae

Please sign in to comment.