Per Google, GCLID, GBRAID and WBRAID can't be used at the same time.
Per Google:
"Considering that for iOS,
gclidis sent if your user has given consent on iOS, andgbraidif the user has not given consent, it makes no sense to send Advanced Conversions email data requesting consent ifgbraidis sent at the same time which implies no consent."
Our integration allows a customer to send all the three parameters together, resulting in cryptic errors in the destination.
Testing
- [ ] Added unit tests for new functionality
- [X] Tested end-to-end using the local server
- [ ] [Segmenters] Tested in the staging environment
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 78.57%. Comparing base (
5a5f52b) to head (cdd0e0f). Report is 114 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #2365 +/- ##
===========================================
+ Coverage 33.18% 78.57% +45.38%
===========================================
Files 14 1027 +1013
Lines 693 18125 +17432
Branches 109 3413 +3304
===========================================
+ Hits 230 14242 +14012
- Misses 463 2748 +2285
- Partials 0 1135 +1135
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
- Flaky Tests Detection - Detect and resolve failed and flaky tests
- JS Bundle Analysis - Avoid shipping oversized bundles
hi @brennan - got a small PR for a change to 2 Actions in Google Enhanced Conversions, raised by @seg-leonelsanches from the SA team.
Could you triage please?
Hi @seg-leonelsanches, thanks for raising this PR. Please provide:
- A link to Google's documentation supporting the change.
- A link to Google's documentation related to the errors customers are seeing (including screenshots of the errors).
- A description of all possible side effects on existing customers (as this change will result in Segment discarding customer events that we previous sent to Google's API).
@brennan This has been problematic when using the Google Ads destination.
You can only send one of gclid, gbraid, or wbraid. But Google will append one or more on the ad final URL.
https://developers.google.com/google-ads/api/docs/conversions/upload-clicks#set_the_required_fields_of_each_conversion_operation
Google's code example shows the following logic:
# Sets the single specified ID field.
if gclid:
click_conversion.gclid = gclid
elif gbraid:
click_conversion.gbraid = gbraid
else:
click_conversion.wbraid = wbraid
This is the error you get from the mapping event tester:
There's no impact in adding this change, customers events are already failing if more than one parameter is being sent.
In addition, this PR doesn't address another issue where if a gbraid or wbraid parameter are sent, Google will reject the payload if it contains an email address and/or phone number.
Error messages: https://developers.google.com/google-ads/api/docs/conversions/upload-clicks#debug_common_errors
| Error | Message |
|---|---|
| ConversionUploadError.GBRAID_WBRAID_BOTH_SET | The ClickConversion has a value set for both gbraid and wbraid. Update the conversion to use only one click ID, and make sure you are not combining multiple clicks into the same conversion. Each click has only one click ID. |
| FieldError.VALUE_MUST_BE_UNSET | Check the location of the GoogleAdsError to determine which of the following issues led to the error. The ClickConversion has a value set for gclid as well as at least one of gbraid or wbraid. Update the conversion to use only one click ID, and make sure you are not combining multiple clicks into the same conversion. Each click has only one click ID. The ClickConversion has a value set for either gbraid or wbraid and has a value for custom_variables. Google Ads does not support custom variables for a conversion with a gbraid or wbraid click ID. Unset the custom_variables field of the conversion. |
Thank you, @brennan and @lukebussey, for your comments. Today I had the opportunity to meet with the Google team, validating all the information contained here, adding answers to this PR's raised questions:
A link to Google's documentation supporting the change.
Links:
- https://developers.google.com/google-ads/api/docs/conversions/upload-clicks#debug_common_errors (provided by @lukebussey);
- https://developers.google.com/google-ads/api/docs/conversions/upload-clicks#code_example (best comment lives in Python example), which says the following:
"""Creates a click conversion with a default currency of USD.
Args:
...
gclid: The Google Click Identifier ID. If set, the wbraid and gbraid
parameters must be None.
...
gbraid: The GBRAID for the iOS app conversion. If set, the gclid and
wbraid parameters must be None.
wbraid: The WBRAID for the iOS app conversion. If set, the gclid and
gbraid parameters must be None.
...
"""
A link to Google's documentation related to the errors customers are seeing (including screenshots of the errors).
That's again https://developers.google.com/google-ads/api/docs/conversions/upload-clicks#debug_common_errors. Below I'm adding the error screenshots:
A description of all possible side effects on existing customers (as this change will result in Segment discarding customer events that we previous sent to Google's API).
The events will be discarded anyway. What changes for us is the opportunity to add better explanatory error messages, as well as updating our documentation to inform our customers of these validations.
@lukebussey, I'll implement the extra suggestion you gave, and then this PR can be re-evaluated by our team. I'll keep everybody posted here.
@brennan Any update on getting this fixed?
hi @seg-leonelsanches and @lukebussey - I'm just back from extended leave. Is this PR something you are still interested in? Or can it be closed?
hi @seg-leonelsanches and @lukebussey - I'm just back from extended leave. Is this PR something you are still interested in? Or can it be closed?
Yes it would still be great as this bug requires difficult workarounds to get conversions sent to Google.
No more cryptic messages, Google Ads API now tells us what is going on:
Hi @lukebussey , I just reviewed this PR and it won't work for batches of events. I've started another PR here which should do the trick.
I still need to test and write unit tests.