Add conversion actions to campaign via Google Ads API

650 views
Skip to first unread message

Chen Xiaowei

unread,
Dec 3, 2021, 5:04:40 AM12/3/21
to AdWords API and Google Ads API Forum
I try to use  CampaignConversionGoal and  ConversionGoalCampaignConfigs to update campaign’s conversion action,but all failed because I cannot get "custom_conversion_goal“ or ”conversion_goal_campaign_config.resource_name“.
I really have 6 conversions in my Google ads UI and can fetch they by "SELECT conversion_action.idconversion_action.name, conversion_action.type FROM conversion_action".
What the difference between custom_conversion_goal and conversion_action?
And I used "SELECT campaign.idcampaign.name, conversion_goal_campaign_config.campaign, conversion_goal_campaign_config.custom_conversion_goal, conversion_goal_campaign_config.goal_config_level, conversion_goal_campaign_config.resource_name FROM conversion_goal_campaign_config"
to get related info but it just returned goalconfiglevel no goal and resource_name.
{
                "campaign": {
                    "resourceName": "customers/XXXX/campaigns/XXXX",
                    "name": "TestShoppingCmapaigns",
                    "id": "XXXX"
                },
                "conversionGoalCampaignConfig": {
                    "resourceName": "customers/XXXX/conversionGoalCampaignConfigs/XXXX",
                    "campaign": "customers/XXXX/campaigns/XXXX",
                    "goalConfigLevel": "CUSTOMER"
                }
}
I find some of my google accounts UI have changed and showed customer goal or campaign goal but my test account is still ooriginal version ,if it's the reason why I can't post the request successfully?
Thank you very much for checking my message!!!


My request:
curl --location --request POST '/v9/customers/XXXX/campaignConversionGoals:mutate' \ --data-raw '{ "operations": [ { "update": { "resource_name":"", "campaign": "customers/XXXX/campaigns/XXXX", "category": "PURCHASE", "origin": "WEBSITE", "biddable": false }, "updateMask": { "paths": "category", "paths":"origin", "paths":"biddable" } } ], "validateOnly": false,
    "responseContentType":"MUTABLE_RESOURCE"
}'

curl --location --request POST '/v9/customers/XXXX/conversionGoalCampaignConfigs:mutate' \ --data-raw '{ "operations": [ { "update": { "resource_name":"customers/XXXX/conversionGoalCampaignConfigs/XXXX", "campaign": "customers/XXXX/campaigns/XXXX", "goal_config_level": "CUSTOMER", "custom_conversion_goal": }, "updateMask": { "paths": " campaign  ", "paths":" goal_config_level  ", "paths":" custom_conversion_goal  " } } ], "validateOnly": false,
    "responseContentType":"MUTABLE_RESOURCE"
}'

Google Ads API Forum Advisor

unread,
Dec 6, 2021, 12:52:51 AM12/6/21
to viviana...@gmail.com, adwor...@googlegroups.com
Hi Chen,

Thank you for reaching out to our API support team.

Could you confirm if you have already referred to this guide prior to updating your conversion goals? I asked because in the guide, for conversion goals and conversion actions, it says that :
  • Conversion goals help you organize your conversion actions so that you can more easily optimize toward your advertising objectives. Goals are organized and identified by the unique combinations of category and origin in the set of ConversionActions in your account's effective conversion account.
  • Your account already has CustomerGoal and CampaignGoal objects for your existing conversion actions.
  • Since Google Ads automatically creates CustomerConversionGoal, CampaignConversionGoal, and ConversionGoalCampaignConfig objects in your account, you can only update those objects. The Google Ads API does not support creating or removing those objects.
That being said, could you also confirm if you have indeed already tried retrieving your campaign goals as mentioned here? Also so that our team can take a closer look, could you share the separate and complete request and response logs, and the request-id, generated when you performed the retrieval and the update?

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2SbBz6:ref

Google Analytics

unread,
Apr 2, 2025, 8:31:09 AMApr 2
to Google Ads API and AdWords API Forum
Hi 

How can I get which goal is associated with the conversion actions, as you mentioned " Goals are organized and identified by the unique combinations of category and origin in the set of ConversionActions in your account's effective conversion account." can you please elaborate more on this how can I know which action is associated with which goal at API level? 

Google Ads API and AdWords API Forum

unread,
Apr 2, 2025, 4:46:15 PMApr 2
to Google Ads API and AdWords API Forum
Hi,

Thank you for reaching out to the Google Ads API support team.

Please note that it is not possible to fetch the goals associated with the conversion actions via API. The campaign conversion goal or customer conversion goal applies to all the conversion actions when the conversion goal category and conversion goal origin matches with the conversion action category and conversion action origin.

Hope this answers your query.

Regards, 
Google Ads API Team.

Reply all
Reply to author
Forward
0 new messages