Skip to content

[STRATCONN-6704] Fix customerId hyphen stripping in GEC batch paths#3747

Open
itsarijitray wants to merge 4 commits intomainfrom
STRATCONN-6704
Open

[STRATCONN-6704] Fix customerId hyphen stripping in GEC batch paths#3747
itsarijitray wants to merge 4 commits intomainfrom
STRATCONN-6704

Conversation

@itsarijitray
Copy link
Copy Markdown
Contributor

@itsarijitray itsarijitray commented Apr 23, 2026

Summary

Jira: https://twilio-engineering.atlassian.net/browse/STRATCONN-6704

  • In performBatch methods of 4 Google Enhanced Conversions actions, customerId hyphens were stripped into a local const but settings.customerId (still containing hyphens) was used in API URLs and/or conversionAction fields, causing Google Ads API failures for customers with hyphenated IDs (e.g. 123-456-7890).
  • Fixed 6 occurrences across 4 files: uploadClickConversion2, uploadCallConversion, uploadCallConversion2, uploadConversionAdjustment2 — replaced settings.customerId with the already-stripped local customerId constant.
  • Added tests with hyphenated customerId values to all 4 affected actions to prevent regression.

Test plan

  • All existing tests pass (89 tests, 55 snapshots across 4 test suites)
  • New tests verify that batch requests with hyphenated customerId produce correct API URLs and conversionAction fields
  • CI passes

Before:
image

🤖 Generated with Claude Code

…onversions batch paths

In performBatch methods, customerId hyphens were stripped into a local
constant but settings.customerId (with hyphens) was still used in API
URLs and conversionAction fields. This caused Google Ads API failures
when customers entered their ID with hyphens (e.g. 123-456-7890).

Fixed 6 occurrences across 4 actions: uploadClickConversion2,
uploadCallConversion, uploadCallConversion2, uploadConversionAdjustment2.
Added tests with hyphenated customerIds to verify the fix.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@itsarijitray itsarijitray requested a review from a team as a code owner April 23, 2026 12:14
Copilot AI review requested due to automatic review settings April 23, 2026 12:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Google Ads API failures for hyphenated customerId values in Google Enhanced Conversions by ensuring batch request paths consistently use the already hyphen-stripped customerId when building API URLs and conversionAction resource names.

Changes:

  • Replaced settings.customerId with the hyphen-stripped local customerId constant in batch request URL and/or conversionAction construction across 4 actions.
  • Added regression tests covering hyphenated customerId behavior for all affected batch actions.
  • Minor formatting/whitespace cleanup in uploadClickConversion2.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/destination-actions/src/destinations/google-enhanced-conversions/uploadConversionAdjustment2/index.ts Uses hyphen-stripped customerId when building batch conversionAction.
packages/destination-actions/src/destinations/google-enhanced-conversions/uploadClickConversion2/index.ts Uses hyphen-stripped customerId in batch conversionAction and batch API URL.
packages/destination-actions/src/destinations/google-enhanced-conversions/uploadCallConversion2/index.ts Uses hyphen-stripped customerId in batch conversionAction and batch API URL.
packages/destination-actions/src/destinations/google-enhanced-conversions/uploadCallConversion/index.ts Uses hyphen-stripped customerId in batch API URL.
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/uploadConversionAdjustment2.test.ts Adds batch regression test for hyphenated customerId (URL + conversionAction).
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/uploadClickConversion2.test.ts Adds batch regression test for hyphenated customerId (URL + conversionAction).
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/uploadCallConversion2.test.ts Adds batch regression test for hyphenated customerId (URL + conversionAction).
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/uploadCallConversion.test.ts Adds batch regression test for hyphenated customerId (URL + conversionAction).

expect(responses[0].status).toBe(201)
})

it('strips hyphens from customerId in batch API URL', async () => {
}
})

it('strips hyphens from customerId in batch conversionAction', async () => {
Addresses Copilot review comments on PR #3747.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.89%. Comparing base (b93a98c) to head (e05c435).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3747      +/-   ##
==========================================
- Coverage   81.08%   80.89%   -0.20%     
==========================================
  Files        1655     1347     -308     
  Lines       32079    25048    -7031     
  Branches     7070     5199    -1871     
==========================================
- Hits        26011    20262    -5749     
+ Misses       5096     3840    -1256     
+ Partials      972      946      -26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings April 23, 2026 12:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Google Ads API request failures for Google Enhanced Conversions (GEC) batch actions when settings.customerId is provided in the common hyphenated form (e.g. 123-456-7890) by ensuring the already-sanitized (hyphen-stripped) customerId is used consistently in batch URL paths and conversionAction resource names.

Changes:

  • Update 4 GEC actions to use the hyphen-stripped customerId constant (instead of settings.customerId) in performBatch request payloads and/or request URLs.
  • Add regression tests across the 4 affected action test suites to validate correct batch API URL construction and conversionAction formatting with hyphenated customerId.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/destination-actions/src/destinations/google-enhanced-conversions/uploadConversionAdjustment2/index.ts Use sanitized customerId in batch conversionAction resource name.
packages/destination-actions/src/destinations/google-enhanced-conversions/uploadClickConversion2/index.ts Use sanitized customerId in batch conversionAction and batch upload URL; minor string/whitespace cleanup in touched hunks.
packages/destination-actions/src/destinations/google-enhanced-conversions/uploadCallConversion2/index.ts Use sanitized customerId in batch conversionAction and batch upload URL.
packages/destination-actions/src/destinations/google-enhanced-conversions/uploadCallConversion/index.ts Use sanitized customerId in batch upload URL.
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/uploadConversionAdjustment2.test.ts Add batch regression test for hyphenated customerId (URL + conversionAction).
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/uploadClickConversion2.test.ts Add batch regression test for hyphenated customerId (URL + conversionAction).
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/uploadCallConversion2.test.ts Add batch regression test for hyphenated customerId (URL + conversionAction).
packages/destination-actions/src/destinations/google-enhanced-conversions/tests/uploadCallConversion.test.ts Add batch regression test for hyphenated customerId (URL + conversionAction).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants