Hanapin is now a
part of Brainlabs

Hanapin is now a part of Brainlabs | Find out what this means


Eliminate Wasted Spend on Out-of-Stocks with Scripts

In their Out of Stock Crisis research, GT Nexus reported “approximately 60% of in-store shoppers and almost 70% of online shoppers became ‘lost sales’ when faced with a stock-out.” These statistics are likely no surprise to e-commerce marketers. Shoppers are likely to become dissatisfied with a brand if the product(s) they are looking to purchase are not available. GT Nexus also reported that 65% of shoppers who became “lost sales” found the product they were searching for through a competitor site. Brand loyalty is less important to shoppers if they can purchase items faster elsewhere.



As marketers, we have little to no control over product inventory. In this whitepaper, we’ll review a solution we’ve implemented several times at Hanapin Marketing to decrease wasted ad spend on out of stock products.




Why Prevent Ads for Out of Stock Products?



E-commerce advertisers are always working towards a return on ad spend goal within any given account. Avoiding accumulating any cost on out of stock products is a guaranteed way to improve wasted spend and lift return. Let’s take the below measuring cup set from Target as an example. Since this is a low price point item, potential return on ad spend is likely already low. Purchasers of this product are unlikely to purchase more than one of this $5.99 product. Factor in conversion rate and CPC, and the likelihood of this product making a significant impact on Target’s performance is minimal.




Unless a shopper is very invested in purchasing this specific copper measuring cup set, they probably won’t be signing up to receive a notification when the product is back in stock. Instead, they’ll either bounce from the Target website or click on the category page to search for similar products. Either way, this user is less likely to make a purchase and the dollar amount spend on their click (and however many more people click during the out of stock time frame) is wasted.



Below is an out of stock example for an armchair on Wayfair’s website. Based on the average high price point for armchairs, we can assume CPCs for this product category are relatively high compared to measuring spoons. Since competition is likely higher for armchair keywords, spend on clicks to this out of stock product page is even more detrimental to account performance. Advertising for products you are not able to sell immediately can also hurt brand loyalty if shoppers encounter inventory issues on your site.





Our Client’s Challenge



Recently, we onboarded an e-commerce account which had had no existing solutions for out of stock product management. This business sells over 40,000 products across 37 different countries. Knowing the impact it could make on performance, we wanted to easily pause ads for products when they went out of stock as well as enable ads for these products once they were available to shoppers. While we understood the importance of pausing ads for out of stock products, we also wanted to focus our time and energy on other aspects of account management and had little time to manually make changes.



Our Solution: Script Implementation



Manually checking products pages does not scale well and requires an unrealistic amount of time for more than a few products. Automatically pausing and labeling ads based on stock opens limits wasted spend and provides additional information to the management team.



The process is straightforward in planning but will need tweaks from website to website. The first step is to identify the correct products (if not all of them), the next step is to check the availability, the final step is take an action. This case will cover Google AdWords scripts but can be applied through other languages and systems.



In order to identify products to track, we used a combination of existing ads and a product feed. From there we matched up which URLs were for specific products and identified the qualifiers to distinguish them from category, brand, and other types of aggregated pages. This ensures we aren’t checking pages that don’t have stock information, which speeds up the process considerably.



Once we know the URLs or the URL pattern,  we need filter down to only the required URLs. Once we have these lists we utilized a function to access the webpage and grab the HTML. Based on samples of backordered, out of stock, temporarily out of stock, and in stock listings we identified the specific parts of the HTML that included each statuses. We used these as filters and reorganized each product URL based on its inventory status.



Once we’d iterated through every URL, the script would then make the required changes and push them to the advertising platform. If an item was listed as temporarily out of stock (for 2-3 days) we’d keep the ads running but bid down. If an item was out of stock for a longer period, such as out of stock from the manufacturer, it would be paused. Each action was also labeled. This allowed the team to easily generate reports on the number of affected ads and by country.




This view allowed the team to be proactive in noticing major changes and addressing them with the client. This additional view and level of reporting allowed the team to proactively address drastic changes with the client and make adjustments as needed.


Since products can come back in stock, we added additional logic to check paused ads or those that had been bid down and reverse the changes if the product was back in stock. By creating a way to reverse the process, the team was confident that they were not losing clicks and revenue for restocked products.



Impact on Performance



After implementing the out of stock script for the e-commerce account mentioned previously, conversion rates improved by nearly 7% within just a few weeks. After three weeks of this script running, 5,570 ads were paused automatically due to the products being out of stock. It’s impossible to know exactly how much wasted spend these ad pauses prevented, but the impact was significant since spend was reallocated to high performing products that were in stock and ready to be purchased.



Impact on Account Management



Implementing this script improved overall return on ad spend and increased account management efficiency. Rather than manually searching for out of stock products and selecting which ads to pause, this script can virtually run with little to no interruption to workflow. Of course, changes in product inventory can impact daily spend, revenue, etc. so be aware of any major changes. If you decide to pause ads for out of stock products, doing so manually is incredibly time consuming and is open to human error.



Next Steps



Success in implementing these tools requires acquiring the right data, finding the right patterns, and having a clear plan of action in place.



For data you can choose to either start with a product feed or use the webpage. The product feed can be easier to handle due to its structure but sometimes the feed file cannot be provided to the vendor. In this case the next solution is to scrape pages on the site. This comes with the weaknesses of being easily broken by HTML changes but these changes are typically infrequent and can be monitored. If you are scraping pages it’s best to have a filtered list of what you need to target based on URL patterns or a predefined list of URLs to limit the load of pulling irrelevant pages from the site.



Once the product pages are identified it’s best to walk through the process and decisions made at each point. What are all the variations of stock level phrasing? What should be done at each point (pause, enable, etc.)? From there this logic can be coded, combined with the stock checker and set live. Out of stocks are a major issue when it comes to e-commerce marketing, but all hope is not lost. With this solution, say goodbye to wasted budget and hello to extra spend!