Skip to content

Fix email/phone normalization and typos in enhanced conversions examples - #1104

Open
pattersonlois wants to merge 2 commits into
googleads:mainfrom
pattersonlois:fix-enhanced-conversions-normalization
Open

pattersonlois wants to merge 2 commits into
googleads:mainfrom
pattersonlois:fix-enhanced-conversions-normalization

Conversation

@pattersonlois

Copy link
Copy Markdown

Fixes normalization and comment/string issues in examples/remarketing/upload_enhanced_conversions_for_leads.py and examples/remarketing/upload_enhanced_conversions_for_web.py:

  1. Email normalization (normalize_and_hash_email_address):

  2. Whitespace normalization (normalize_and_hash):

    • Uses re.sub(r"\s+", "", s).lower() instead of s.strip().lower() so intermediate spaces in phone numbers (such as "+1 800 5550102") are stripped to produce valid E.164 format ("+18005550102").
  3. Typos, comments, and CLI descriptions:

    • Fixes f"order ID {result,order_id}." -> f"order ID {result.order_id}." and missing space in upload_enhanced_conversions_for_web.py.
    • Fixes SHA-265 -> SHA-256 docstring typo, ArgumentParser descriptions, comment inaccuracies, and doubled quote typos ("..."" and '{ex.request_id}'') in both files.

@aleksUIX

Copy link
Copy Markdown

normalize_and_hash() also builds hashed_first_name and hashed_last_name in the web example, so this change hashes Mary Jane as maryjane. The enhanced-conversions guide and its Java/PHP address examples preserve internal spaces. These are different identifiers for matching. Can we keep trim-and-lowercase for names, remove internal whitespace only for phone numbers, and add a regression test with a multiword first or last name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants