Add multiple placements using api

30 views
Skip to first unread message

soundarya sparks

unread,
Mar 16, 2018, 6:36:56 AM3/16/18
to AdWords API Forum
How to add multiple placements in display network tab using API and how to retrieve them?I am using campaign criteria service to get placements but i am not getting any placement urls.
 [
                new Predicate('CampaignId', PredicateOperator::IN, [$campaignId]),
                new Predicate(
                    'CriteriaType',
                    PredicateOperator::IN,
                    [
         
                        'KEYWORD',

                        'AGE_RANGE',

                        'PLACEMENT'
                    ]
                )
            ]
        );

and the outout i am getting is 
Campaign targeting criterion with ID 503001 and type 'AGE_RANGE' was found.

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Mar 16, 2018, 3:00:29 PM3/16/18
to AdWords API Forum
Hi, 

The Placements criterion can only be targeted at an AdGroup level. At a campaign level, this can only be excluded. Please check here for more details about criteria usage. To add a negative campaign criterion, please refer to AddCampaignTargetingCriteria sample. The sample adds a negative keyword. In your case, you will need to set the attributes of a placement instead. To retrieve the campaign level negative criterion, you could use the CampaignCriterionService.get() and filter by CriteriaType "PLACEMENT". Please check the GetCampaignTargetingCriteria sample for reference. You will need to include PlacementUrl and any other fields of your choice in your selector. 

If you are having trouble getting the results for CampaignCriterionService, could you please share the campaign ID which has the placement and not being returned? Please note that, if the placement is added at the AdGroup level, you will have to use the AdGroupCriterionService.get() instead. If you need a sample for this, please check GetKeywords which uses AdGroupCriterionService to get the keywords. 

Thanks,
Sreelakshmi, AdWords API Team

soundarya sparks

unread,
Mar 19, 2018, 9:02:16 AM3/19/18
to AdWords API Forum
Thank you for the help.now,I am able to add single placement url.Can I add multiple urls at a time? 

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Mar 19, 2018, 12:36:04 PM3/19/18
to AdWords API Forum
Hi, 

Using the AdGroupCriterionService or CampaignCriterionService you could perform 5000 operations ( ADD placements) at a time. However, for performance reasons, we recommend limiting the number of operations to 2000 at a time. Please check the guide on limits for more details. You could also use BatchJobService to add the criteria in bulk. Please refer to the batch processing guide for more details. You could take a look at AddKeywordsUsingIncrementalBatchJob sample which adds keywords in bulk using the BatchJobService. 

Let me know if you have any additional questions.
Reply all
Reply to author
Forward
0 new messages