[STRATCONN-6704] Fix customerId hyphen stripping in GEC batch paths#3747
[STRATCONN-6704] Fix customerId hyphen stripping in GEC batch paths#3747itsarijitray wants to merge 4 commits intomainfrom
Conversation
…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]>
There was a problem hiding this comment.
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.customerIdwith the hyphen-stripped localcustomerIdconstant in batch request URL and/orconversionActionconstruction across 4 actions. - Added regression tests covering hyphenated
customerIdbehavior 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
customerIdconstant (instead ofsettings.customerId) inperformBatchrequest payloads and/or request URLs. - Add regression tests across the 4 affected action test suites to validate correct batch API URL construction and
conversionActionformatting with hyphenatedcustomerId.
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). |
Summary
Jira: https://twilio-engineering.atlassian.net/browse/STRATCONN-6704
performBatchmethods of 4 Google Enhanced Conversions actions,customerIdhyphens were stripped into a localconstbutsettings.customerId(still containing hyphens) was used in API URLs and/orconversionActionfields, causing Google Ads API failures for customers with hyphenated IDs (e.g.123-456-7890).uploadClickConversion2,uploadCallConversion,uploadCallConversion2,uploadConversionAdjustment2— replacedsettings.customerIdwith the already-stripped localcustomerIdconstant.customerIdvalues to all 4 affected actions to prevent regression.Test plan
customerIdproduce correct API URLs andconversionActionfieldsBefore:

🤖 Generated with Claude Code