Repository navigation
Fix email/phone normalization and typos in enhanced conversions examples - #1104
Open
pattersonlois wants to merge 1 commit into
Open
pattersonlois wants to merge 1 commit into
pattersonlois wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes normalization and comment/string issues in
examples/remarketing/upload_enhanced_conversions_for_leads.pyandexamples/remarketing/upload_enhanced_conversions_for_web.py:Email normalization (
normalize_and_hash_email_address):gmail.com/googlemail.comdomain check removed in Fix example to also normalize plus character in emails #1050 so periods and+suffixes are only stripped forgmail.comandgooglemail.comaddresses, matching the Google Ads API email normalization guidelines.str.maketrans("", "", ".+")(which only stripped the literal+character) with.replace(".", "")andre.sub(r"\+.*$", "", email_parts[0])to remove+and all subsequent characters up to@.Whitespace normalization (
normalize_and_hash):re.sub(r"\s+", "", s).lower()instead ofs.strip().lower()so intermediate spaces in phone numbers (such as"+1 800 5550102") are stripped to produce valid E.164 format ("+18005550102").Typos, comments, and CLI descriptions:
f"order ID {result,order_id}."->f"order ID {result.order_id}."and missing space inupload_enhanced_conversions_for_web.py.SHA-265->SHA-256docstring typo,ArgumentParserdescriptions, comment inaccuracies, and doubled quote typos ("...""and'{ex.request_id}'') in both files.