Open elishakutnick opened 7 months ago
Our smart campaign example doesn't require a Google merchant center ID as a parameter. Can you clarify exactly what code you're running to encounter this behavior?
@mcloonan our code can be viewed here
For some reason the error didn't propagate correctly to your side. I looked up what happened on our server logs for this request ID, and the error message there should be more useful:
[{
error_code: "FieldError.REQUIRED",
field_path: "mutate_operations[3].campaign_criterion_operation.",
error_message: "The required field was not present."
},{
error_code: "FieldError.IMMUTABLE_FIELD",
field_path: "mutate_operations[5].ad_group_ad_operation.create.ad",
error_message: "The field attempted to be mutated is immutable."
}]
So this means you didn't specify a campaign_criterion_operation that was required, and also that you attempted to mutate the "ad" field which is immutable. So the error isn't actually about the extra fields that appear but you don't specify. I just tested this on my side and they appear in my successful request (using our example as is without modifications) as well.
Hi @mcloonan Thanks for the prompt response and sharing the more helpful error message. I believe I know why the first error (missing a required field) is happening, but would appreciate more information on the immutable "ad" field.
If you see our implementation of def create_smart_campaign_ad_group_ad_operation(campaign)
in the previously linked code examples, it closely mirrors that of https://github.com/googleads/google-ads-ruby/blob/main/examples/advanced_operations/add_smart_campaign.rb#L528. Are you able to provide more detail on the discrepancy that you may be seeing between our implementation and the example code that you successfully executed?
Hi @mcloonan just following up in case my previous message got buried. We'd appreciate any further direction you're able to share -- thank you!
Looking at your request compared to the example we have, it looks like you're only specifying the ad's type
field, but there are a bunch of other required fields as well. See: https://github.com/googleads/google-ads-ruby/blob/main/examples/advanced_operations/add_smart_campaign.rb#L528
The error message I provided for this is not very clear, but if you supply all of the required fields as demonstrated in the example, it should work.
Describe the bug: https://github.com/googleads/google-ads-ruby/blob/main/examples/advanced_operations/add_smart_campaign.rb was used as reference in our implementation, but we've been unable to successfully create a smart campaign. More specifically, we heard from the Google Ads API team that we are passing output-only fields in the request body (
primary_status_reasons: [], serving_status::UNSPECIFIED, bidding_strategy_system_status::UNSPECIFIED
). While you can see these fields in the response, these fields are not included in our implementation and we are curious if this is a bug specific to the version of the Ads API we are currently using.Steps to Reproduce: Create smart campaign
Expected behavior: Successful creation of a smart campaign
Client library version and API version: Client library version: Google Ads API version: 14
Request/Response Logs:
Additional response examples + code implementation viewable in https://docs.google.com/document/d/1slXm_fk5DK3L3mPJq_cvYgcfQMZxFfL61q6JUBvZ4Pk/edit
Anything else we should know about your project / environment: