diff --git a/examples/remarketing/upload_enhanced_conversions_for_leads.py b/examples/remarketing/upload_enhanced_conversions_for_leads.py index a32c813a0..a8856bde5 100644 --- a/examples/remarketing/upload_enhanced_conversions_for_leads.py +++ b/examples/remarketing/upload_enhanced_conversions_for_leads.py @@ -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) diff --git a/examples/remarketing/upload_enhanced_conversions_for_web.py b/examples/remarketing/upload_enhanced_conversions_for_web.py index edc4260e4..07895c9a8 100644 --- a/examples/remarketing/upload_enhanced_conversions_for_web.py +++ b/examples/remarketing/upload_enhanced_conversions_for_web.py @@ -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)