TargetingSetting at the campaign level

22 views
Skip to first unread message

Christopher Taylor

unread,
Jul 10, 2018, 12:56:58 PM7/10/18
to AdWords API and Google Ads API Forum
Trying to set TargetingSetting attributes via the PHP libraries at the campaign level, but receiving this error:


Unmarshalling Error: cvc-type.2: The type definition cannot be abstract for element ns1:settings


Only see examples for setting at the adgroup level and not the campaign level but is this the proper way to set this?

$targetingSetting = new TargetingSetting();
$targetingSetting->details[] = new TargetingSettingDetail('USER_INTEREST_AND_LIST', true);
$targetingSetting->targetAll = 'true';

$campaign->settings[] = $targetingSetting;

Milind Sankeshware (AdWords API Team)

unread,
Jul 10, 2018, 5:52:41 PM7/10/18
to AdWords API and Google Ads API Forum
Hi Christopher,

Could you please try code below:

$details []= null; $targetingSetting = new TargetingSetting(); $detail = new TargetingSettingDetail(); $detail->setCriterionTypeGroup = 'USER_INTEREST_AND_LIST'; $detail->setTargetAll = true; $details [] = $detail; $targetingSetting->setDetails($details);

If you are still facing any issue, please share the complete code snippet so that I can troubleshoot the issue?

Thanks,
Milind, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages