Hello Google Ads Community,
I am trying to create a Demand Gen campaign using the PHP client library
(version 19). My goal is to set the campaign objective to "Clicks" as it
appears in the Google Ads UI.
[image: Screenshot 2025-08-18 at 9.51.12 PM.png]
However, I'm facing an API error that I can't resolve. I initially tried
using maximize_clicks, but that resulted in a No such field maximize_clicks
error, even with the latest library. After trying a different approach, the
issue persists.
Here is my code snippet for creating the campaign. I've noted that I am
currently using maximize_conversions as a test, but my true goal is
"Clicks".
try {
// Creates a single shared budget to be used by the campaigns added
below.
$budgetResourceName = $this->addCampaignBudget($customerId, $params);
$budgetResourceName =
json_decode($budgetResourceName->getContent(),true);
// Build network settings
$networkSettings = new NetworkSettings([
'target_google_search' => true,
'target_search_network' => true,
'target_content_network' => true,
'target_partner_search_network' => false
]);
$name = $params['name'];
// Prepare your campaign parameters
$campaignData = [
'name' => $name,
'advertising_channel_type' => AdvertisingChannelType::DEMAND_GEN,
'campaign_budget' => $budgetResourceName['response'],
'network_settings' => $networkSettings,
'maximize_conversions' => new MaximizeConversions(), // This is a
placeholder; I need 'Clicks'
'status' => CampaignStatus::PAUSED
];
if (!empty($params['start_date'])) {
$campaignData['start_date'] = $params['start_date'];
}
if (!empty($params['end_date'])) {
$campaignData['end_date'] = $params['end_date'];
}
$campaign = new Campaign($campaignData);
// ... (rest of the code to mutate the campaign)
} catch (GoogleAdsException $ex) {
// ... (error handling)
}
My core issue is: *What is the correct way to set the bidding strategy for
a "Clicks" goal on a Demand Gen campaign using the PHP client library?*
Any guidance or a working code example would be greatly appreciated.
Thank you!
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/adwords-api/d66b113e-4c9a-4cd9-a19d-171b949f6cf7n%40googlegroups.com.