Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions examples/remarketing/upload_enhanced_conversions_for_leads.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,10 @@ def normalize_and_hash_email_address(email_address: str) -> str:

# Check that there are at least two segments
if len(email_parts) > 1:
# Checks whether the domain of the email address is either "gmail.com"
# or "googlemail.com". If this regex does not match then this statement
# will evaluate to None.
if re.match(r"^(gmail|googlemail)\.com$", email_parts[1]):
# Removes any '.' characters from the portion of the email address
# before the domain if the domain is gmail.com or googlemail.com.
email_parts[0] = email_parts[0].replace(".", "")
normalized_email = "@".join(email_parts)
# Removes any '.' and '+' characters from the portion of the email address
# before the domain
email_parts[0] = email_parts[0].replace(".", "").replace("+","")
normalized_email = "@".join(email_parts)

return normalize_and_hash(normalized_email)

Expand Down
12 changes: 4 additions & 8 deletions examples/remarketing/upload_enhanced_conversions_for_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,10 @@ def normalize_and_hash_email_address(email_address):

# Check that there are at least two segments
if len(email_parts) > 1:
# Checks whether the domain of the email address is either "gmail.com"
# or "googlemail.com". If this regex does not match then this statement
# will evaluate to None.
if re.match(r"^(gmail|googlemail)\.com$", email_parts[1]):
# Removes any '.' characters from the portion of the email address
# before the domain if the domain is gmail.com or googlemail.com.
email_parts[0] = email_parts[0].replace(".", "")
normalized_email = "@".join(email_parts)
# Removes any '.' and '+' characters from the portion of the email address
# before the domain
email_parts[0] = email_parts[0].replace(".", "").replace("+","")
normalized_email = "@".join(email_parts)

return normalize_and_hash(normalized_email)

Expand Down