How to update a goals with Python?

229 views
Skip to first unread message

Kieran Eddy

unread,
Mar 10, 2022, 10:03:19 PM3/10/22
to Google Ads API and AdWords API Forum
mutate_operation = client.get_type("MutateOperation")
conversion_goal_campaign_config = (
mutate_operation.conversion_goal_campaign_config.update
)
field_mask= protobuf_helpers.field_mask(None,conversion_goal_campaign_config._pb)
client.copy_from(
conversion_goal_campaign_config_operation.update_mask,field_mask
)

Google Ads API Forum Advisor

unread,
Mar 11, 2022, 6:05:15 AM3/11/22
to 05292...@gmail.com, adwor...@googlegroups.com

Hi there,

Thanks for reaching out to the Google Ads API Forum.

I am afraid that there is no sample code for custom conversion goals, and how to update it to your campaign. However, to update the campaign's ConversionGoalCampaignConfig, setting the custom_conversion_goal to the resource name of the CustomConversionGoal from the previous step, and setting the operation's update_mask to custom_conversion_goal.

You can find here, the guide regarding conversion / campaign goals. This guide then provides more information on how you may manage your campaign goals.

You can then use the below services : 

Let us know if you have any further questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2XnXhh:ref

san...@knorex.com

unread,
May 11, 2022, 3:32:21 AM5/11/22
to Google Ads API and AdWords API Forum
I can create customConversionGoal & attach to campaign.
How to remove/unlink custom conversion goal from that campaign?
I tried to clear custom_conversion_goal or set custom_conversion_goal="" but it give error:
Body: null
Failure message: errors {
  error_code {
    field_mask_error: FIELD_MASK_MISSING
  }
  message: "Cannot use empty field mask in update operation."
  location {
    field_path_elements {
      field_name: "operations"
      index: 0
    }
  }
}
request_id: "M13bOYnsJhBglV8OdSMxJg"

Google Ads API Forum Advisor

unread,
May 11, 2022, 12:39:50 PM5/11/22
to san...@knorex.com, adwor...@googlegroups.com

Hello Martin,

Thanks for replying back.
For us to investigate, could you please provide us with the complete request and response logs with request-id and request-header generated on your end, so that our team may take a closer look at the issue you’re experiencing.

For the client library, logging can be enabled by navigating to the Client libraries > Your client library (ex. python) > Logging documentation, which you can access from this link.

Please send the requested details via the Reply privately to the author option. If this option is not available, you may send the details directly to our googleadsapi-support@google.com alias by referring to this thread.

Best Regards,

Google Logo
Jakeia
Google Ads API Team
 

ref:_00D1U1174p._5004Q2XnXhh:ref
Reply all
Reply to author
Forward
0 new messages