Adds examples for conversion enhancements and form data uploads#486
Adds examples for conversion enhancements and form data uploads#486
Conversation
Also adds an `--orderId` parameter to UploadOfflineConversion since order ID is required for enhancements.
|
This PR moves the example changes made in tg/1173607 (reviewed by Adam and Nick) into |
| // User identifiers for conversion enhancements MUST use first party data. | ||
| .setUserIdentifierSource(UserIdentifierSource.FIRST_PARTY) | ||
| .setAddressInfo( | ||
| OfflineUserAddressInfo.newBuilder() |
There was a problem hiding this comment.
It doesn't look like the OfflineUserAddressInfo builder is ever actually built. Is this correct? Does it work?
There was a problem hiding this comment.
Yep, this works. Setters are usually overloaded to take either the type of the field or its corresponding builder type.
I was using this feature for the sake of brevity, but do you think this will be confusing for users? If so, I can add explicit build() calls in the relevant spots.
|
|
||
| if (restatementValue != null) { | ||
| // Creates a builder to construct the restated conversion value. | ||
| RestatementValue.Builder valueBuilder = enhancementBuilder.getRestatementValueBuilder(); |
There was a problem hiding this comment.
It doesn't look like valueBuilder builder is ever actually built. Is this correct? Does it work?
There was a problem hiding this comment.
This works as well since the valueBuilder is created from the enhancementBuilder, and the latter will be built when it's set during request construction below.
| conversionUploadServiceClient.uploadConversionAdjustments( | ||
| UploadConversionAdjustmentsRequest.newBuilder() | ||
| .setCustomerId(Long.toString(customerId)) | ||
| .addConversionAdjustments(enhancementBuilder) |
There was a problem hiding this comment.
It doesn't look like enhancementBuilder builder was ever actually built. Is this correct? Does it work?
Also adds an
--orderIdparameter to UploadOfflineConversionsince order ID is required for enhancements.