Set Optimization Type to Secondary using Google Ads API

161 views
Skip to first unread message

Josh Lee

unread,
Apr 11, 2023, 4:31:11 PM4/11/23
to Google Ads API and AdWords API Forum
I am trying to create a conversion action using the Google Ads API. I've found that when I create the conversion action, it is automatically set as a "Primary" Optimization Type. However, I'd like to create the conversion action and set the Optimization type to "Secondary". The only thing that looks remotely close to achieving this is this code:

conversion_action.include_in_conversions_metric = False

However, when I try to send a request to create the conversion action with this metric set to False, I receive a response from Google that says:

message: "The field attempted to be mutated is immutable."

Does anyone know how to create the conversion action while setting this Conversion Type to Secondary?

Josh Lee

unread,
Apr 11, 2023, 4:34:07 PM4/11/23
to Google Ads API and AdWords API Forum
optimization type.PNG
This is what I'm referring to. The conversion action optimization is set to Primary by default. I want to set it secondary when I create the conversion type with the API.

Josh Lee

unread,
Apr 11, 2023, 5:23:38 PM4/11/23
to Google Ads API and AdWords API Forum
Just found the correct setting for anyone else with the same problem:

conversion_action.primary_for_goal = False

Google Ads API and AdWords API Forum

unread,
Apr 12, 2023, 5:51:36 AM4/12/23
to Google Ads API and AdWords API Forum

Re-posting the last inquiry (https://groups.google.com/g/adwords-api/c/FhCTsiyYMEwfrom the forum as it wasn't routed to our support queue.


Regards,
Google Ads API Team

Google Ads API and AdWords API Forum

unread,
Apr 12, 2023, 11:45:21 AM4/12/23
to Google Ads API and AdWords API Forum
Hi,

Thank you for raising this concern to the Google Ads API support team. 

I am glad to hear that you are able to find the correct setting. I would also suggest referring to our Conversion goals (https://developers.google.com/google-ads/api/docs/conversions/goals/overview) and Conversion action settings (https://developers.google.com/google-ads/api/docs/conversions/goals/overview#conversion_action_settings) for more informations about this.

Regards,
Google Ads API Team
On Wednesday, April 12, 2023 at 5:23:38 AM UTC+8 jo...@adlinks.io wrote:
Reply all
Reply to author
Forward
0 new messages