Unable to Set Campaign Objective via Google Ads API

88 views
Skip to first unread message

dhrutish ramoliya

unread,
Feb 20, 2025, 8:04:11 AMFeb 20
to Google Ads API and AdWords API Forum

I'm trying to set the campaign objective while creating a new campaign using the Google Ads API (V18), but the class Google\Ads\GoogleAds\V18\Enums\CampaignObjectiveEnum\CampaignObjective is not found.

  • Environment: Google Ads API V18, PHP SDK
  • Steps Taken:
    1. Verified namespace and API version.
    2. Attempted to use CampaignObjectiveEnum\CampaignObjective but encountered a "Class Not Found" error.
    3. Checked the documentation, but campaign objectives don’t seem directly configurable via the API.
  • Questions:
    1. Is it possible to programmatically set a campaign objective when creating a campaign?
    2. If not, is there an alternative method to apply a campaign objective after campaign creation?
    3. Are there any planned updates to the API that will allow setting objectives via API?

Any help or insights would be appreciated!

Google Ads API Forum Advisor

unread,
Feb 20, 2025, 12:39:16 PMFeb 20
to dhrutish...@gmail.com, adwor...@googlegroups.com
Hi,

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

Upon checking your concern, I understand that you are looking for guidance on how to implement the campaign objective using the Google Ads API. Kindly note that campaign goals allow you to optimize individual campaigns for specific conversion actions. If your campaigns have goals that differ from your account-level goals, you can adjust each CampaignConversionGoal and its biddable setting accordingly. I would recommend you to kindly refer to the "Campaign goals" and "Customer goals" documentation to implement the campaign objective from the Google Ads API. 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. Also, I would suggest you to customers.campaignConversionGoals.mutate method to update the conversion goals from the Google Ads API. 

I hope this helps!


Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-02-20 17:38:37Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02vH2qh:ref" (ADR-00289017)


 


yono acc

unread,
Jun 13, 2025, 4:39:13 AMJun 13
to Google Ads API and AdWords API Forum

Hi,

Thank you for the information regarding CampaignConversionGoal and the use of customers.campaignConversionGoals.mutate.

I wanted to confirm whether the "campaign objective" feature (such as Sales, Leads, Website Traffic, App Promotion, Awareness and Consideration, Local Store Visits and Promotion) is directly supported in the latest version of the Google Ads API.

If it is not directly supported, could you please clarify how we can programmatically set these campaign objectives using the API?

I understand from the documentation that goals are identified by unique combinations of category and origin within the set of ConversionActions in the effective conversion account. However, it's still unclear how to explicitly associate one of the predefined campaign objectives (like Sales or Leads) with a campaign via the API.

Any clarification or guidance would be greatly appreciated.

Reply all
Reply to author
Forward
0 new messages