Adding Negative Keywords to Pmax Campaigns

112 views
Skip to first unread message

Manas Bagul

unread,
Mar 17, 2025, 9:02:24 AMMar 17
to Google Ads Scripts Forum
Hi, 

I have recently been working on a script to add negative keywords to pmax campaigns. Since this cannot be done via a negative keyword list, I found that Negative Words can be added via the Google Ads UI. 

But I have a lot of accounts which have pmax campaigns to which I want to add Negative Keywords. So, I shifted to Google Ads Script. But all I could find was functions to add negative keyword LISTS to campaigns. 

Is there such a provision for negative keywords as well?

Thanks and Regards,
Manas Bagul

***
This communication is confidential, may be privileged, and is meant only for the intended recipient and purpose. No part of this email or any files transmitted with it can be shared, copied, forwarded, published online or offline, or used in any unauthorised manner. If you are not the intended recipient, please preserve the confidentiality of the contents, delete the e-mail and attachments (if any) from your system, and inform the sender immediately.
***

Sebastian Berg

unread,
Mar 17, 2025, 11:26:02 AMMar 17
to Google Ads Scripts Forum
Hi Manas, 

If you reach out to your account manager / Shopping team, they can add a negative keyword list to any PMAX campaign in your account.

Google Ads Scripts Forum Advisor

unread,
Mar 17, 2025, 1:14:18 PMMar 17
to adwords...@googlegroups.com
Hi Manas,

Thank you for reaching out to the Google Ads Scripts support team.

@Sebastian, thank you for your input to the user query.

I would like to inform you that it is not possible to add negative keywords to your Performance Max campaign via the Google Ads Scripts.   Performance Max negative keywords are applicable to Search and Shopping inventory only. Please refer to the help center article Negative keywords in Performance Max campaigns to get more information. 

I hope this helps! Feel free to get back to us in case of any further queries.

Thanks,
 
Google Logo Google Ads Scripts Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-03-17 17:13:48Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02vHAaX:ref" (ADR-00294950)



Manas Bagul

unread,
Mar 18, 2025, 1:06:23 AMMar 18
to Google Ads Scripts Forum
Hi @Sebastian, 

The issue with manually adding these negative keywords is that I have a ton of accounts which have PMAX campaigns. Manually, it would take a lot of time.

Manas Bagul

unread,
Mar 18, 2025, 1:14:46 AMMar 18
to Google Ads Scripts Forum
Hi, 

I have already referred the link that you've provided me, but I wanted to do it via Ads Scripts. But since it isn't possible, I'll look for another solution.

Also, I don't know if it's a bug or whether Ads Scripts don't support the operation, but, the following piece of code gives me 0 PMAX campaigns as output. I have 1 active, 1 paused and 3 removed PMAX campaigns in the account I provide to the code. Note that when I put channel type as SEARCH, the code works flawlessly.

const pMaxCampaignIterator = AdsApp.campaigns().withCondition(`campaign.advertising_channel_type!="PERFORMANCE_MAX"`).get();

Would appreciate any help here.

Thanks and Regards, 
Manas Bagul

Google Ads Scripts Forum Advisor

unread,
Mar 18, 2025, 3:57:32 AMMar 18
to adwords...@googlegroups.com
Hi,

I would like to inform you that "AdsApp.campaign()" will work only for search and display campaigns. I would recommend you to use the AdsApp.performanceMaxCampaigns() to work with pmax campaigns. You can refer to the sample examples documentation for more information. If you would like to fetch the data for different types of campaigns, then you can use the reporting option available in Google Ads Scripts using campaign.advertising_channel_type condition. You can refer to the below sample query and you can use the query builder to add additional fields.
const pMaxCampaignIterator = AdsApp.performanceMaxCampaigns().get();
SELECT campaign.id, campaign.name FROM campaign WHERE 
campaign.advertising_channel_type IN ('DISPLAY', 'PERFORMANCE_MAX', 'SEARCH', 'VIDEO')
Feel free to get back in case of any further queries.
 

Thanks,
 
Google Logo Google Ads Scripts Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-03-18 07:57:06Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02vHAaX:ref" (ADR-00294950)



Manas Bagul

unread,
Mar 18, 2025, 4:06:07 AMMar 18
to Google Ads Scripts Forum
Hi, 

The "bug" I reported was a mistake on my part. I resolved it using the function you mentioned shortly after reporting it. Thanks for your response anyway.

Regards,
Manas Bagul

Nils Rooijmans

unread,
Mar 21, 2025, 4:18:05 AMMar 21
to Google Ads Scripts Forum
Hi Manas,

you can follow Sebastian's suggestion to have the support team attached negative keyword list(s) to your PMax campaigns, and then use scripts to add negative keywords to the list.

See details:

Hope this helps,

Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/

Reply all
Reply to author
Forward
0 new messages