Hi,
Thanks for providing the information. I just noticed the following things in your codes:
1. For the AddAdGroups.php, you seemed to be missing the code line for targetingSetting be set on the adGroup (e.g. $adGroup->settings[] = $targetingSetting;). I highlighted the missing line so you could compare it with your code and add this line accordingly.
Thanks for providing the information. I just noticed the following things in your codes:
1. For the AddAdGroups.php, you seemed to be missing the code line for targetingSetting be set on the adGroup (e.g. $adGroup->settings[] = $targetingSetting;). I highlighted the missing line so you could compare it with your code and add this line accordingly.
2. For the AddKeywords.php, you seemed to be adding the Keyword object as criterion of the adGroup. As informed in my previous post, you may use this example code but you need to replace the Keyword object to CriterionUserList object and set it as the criterion of the BiddableAdGroupCriterion. You may try to do the following code to set the CriterionUserList object instead of Keyword:
$adGroupCriterionService =$user->GetService('AdGroupCriterionService', ADWORDS_VERSION);$criterionUserList = new CriterionUserList();
$criterionUserList->userListId = Id of the CriterionUserList you created using the AddCrmBasedUserList.php example code.
// Create biddable ad group criterion.
$adGroupCriterion = new BiddableAdGroupCriterion();
$adGroupCriterion->adGroupId = Your adGroupId;
$adGroupCriterion->criterion = $criterionUserList;// Create operation.$operation = new AdGroupCriterionOperation();$operation->operand = $adGroupCriterion;$operation->operator = 'ADD';$operations[] = $operation;// Make the mutate request.$result = $adGroupCriterionService->mutate($operations);
After that, you may want to change the attributes (e.g. text, matchTye, etc.) in the printf as these attributes belong to the Keyword object. You may want to change them to print the attributes of the adGroupCriterion or the CriterionUserList object.
Hope this helps.
Best Regards,
Joyce, AdWords API Team
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 "AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/d9f55110-bfb2-44f6-a4e6-c6e492f75349%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment