Pause out of stock products with this Google Ads Script - 9.28.2021

401 views
Skip to first unread message

Olivia Prentiss

unread,
Sep 28, 2021, 1:51:58 PM9/28/21
to Google Ads Scripts Forum
Hi, I am attempting to set up an Out of stock script for a client that has 2 out of stock options (in-store pick up & delivery) I found the script here: https://searchengineland.com/pause-out-of-stock-products-with-this-google-ads-script-325561

the lines that needed to be updated are attached. I am guessing my issue is line 22, as I want this to be applied to all campaigns and the  URL for product pages contains /products/ 

an example of a product page that is out of stock can be found here: https://www.staples.ca/products/2984891-en-hp-envy-6055-all-in-one-printer

Capture.JPG

Google Ads Scripts Forum Advisor

unread,
Sep 29, 2021, 3:59:40 AM9/29/21
to adwords...@googlegroups.com
Hi Olivia,

Thanks for reaching out. Harry here, from the Google Ads Scripts Team.

Can you kindly more context to the changes you would like to perform onto the third party script you provided? The script is currently implemented to work with entities at the Ad level. Can you kindly confirm you would like the script to execute at the Campaign level instead? On the other hand, it looks like the script already checks for URLs that contains the "/products/" text.

Moreover, I believe the third party script would only work with product pages that explicitly displays a product is out of stock or sold out while the product link you provided says that the product no longer exists or the page is not found. With this, can I interest with using our very own Link Checker - Single Account instead?

Let me know your thoughts. Looking forward to your reply.

Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2OUse5:ref

Olivia Prentiss

unread,
Sep 29, 2021, 4:33:13 PM9/29/21
to Google Ads Scripts Forum

Google Ads Scripts Forum Advisor

unread,
Sep 29, 2021, 11:42:04 PM9/29/21
to adwords...@googlegroups.com
Hi Olivia,

No worries. Thanks for coming back and providing more URLs. Let me itemize your concerns below:
  1. /products/ - I believe the script already performs the checking for this one. See line 25 and 73.
  2. Out of Stock for Delivery - You can update line 22 with <span>Out of Stock for Delivery</span>
  3. label - Can you kindly provide more context here? With the way the script was implemented, it seems to label out of stock products with 'Paused – Out of Stock' where ads are paused. The script also auto-enables ads that are back in stock. It reviews all ads that are labeled “Paused – Out of Stock” to see if the product is back in stock and if it is it will re-enable the ads. Kindly read through the how the script works section. On the other hand, do you want the script to only handle ads that has a specific label? If yes, then you would have to add another withCondition on line 55 like the below:
    • var label = ''
      return AdWordsApp.ads().withCondition(query).withCondition("LabelNames CONTAINS_ANY [ '"+ label + "']").get()
Reply all
Reply to author
Forward
0 new messages