This feature allows users to sign up to be notified when a product is back in stock.
For this project I was tasked with creating an experience where customers could sign up to be notified when an item is back in stock. First, I wrote JavaScript to target the out of stock items on the PLP and Search pages and inserted a "Notify Me" button in place of the Add to Cart button. Next, I inserted HTML into the page for the modal window and form that would be triggered by the button.
I set up a click handler for the button that would collect data from our data layer and the DOM, such as User ID and Product Title, and insert it into the form's hidden fields. I also used the data layer to populate the product name into the modal heading. Finally, I added an AJAX request that submits the form to a database hosted by our ESP (Acoustic), so we can send triggered emails when something is back in stock. The script for this experience was injected into the site using Adobe Target.
View on CodePen >