Pausing Ad Groups in an Array

22 views
Skip to first unread message

sz...@mymail.mines.edu

unread,
Jul 10, 2018, 4:04:12 PM7/10/18
to AdWords API and Google Ads API Forum
Hello,

If I have a list of adgroups in an array, or at least their ID or something similar, can I pause them without having to use a selector? Essentially I am filtering the adgroups to see which need to be paused using my own algorithm, as the predicates are not specific enough. Thus I put all the ads i want to pause into an array. How would I got about pausing these?

Thanks,

Sean

Luis Xander Talag (AdWords API Team)

unread,
Jul 11, 2018, 12:23:16 AM7/11/18
to AdWords API and Google Ads API Forum
Hi Sean,

You don't need a selector if your goal is just to pause the ad group. All you need to do is to create a loop for your array and set directly each ad group id and ad group status to PAUSE. You may refer to below code snippet for simple SET operation of the ad group.

   <soapenv:Body>
        <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201806">
            <operations>
                <operator>SET</operator>
                <operand>
                    <id>1234567890</id>
                    <status>PAUSED</status>
                </operand>
            </operations>
        </mutate>
    </soapenv:Body>

Thanks and regards,
Luis
AdWords API Team

sz...@mymail.mines.edu

unread,
Jul 11, 2018, 4:16:50 PM7/11/18
to AdWords API and Google Ads API Forum
Awesome, Thank you! Not sure how to use the operand to set the id, as I've never had to do that before. If you could give me some pesudocode or php code to show me how to do that, that would be great!

Luis Xander Talag (AdWords API Team)

unread,
Jul 11, 2018, 11:46:21 PM7/11/18
to AdWords API and Google Ads API Forum
Hi Sean,

You may refer to this sample code in PHP on how to set the ad group id to your operand.

Regards,
Luis
AdWords API Team
Reply all
Reply to author
Forward
0 new messages