Lightboxes are useful for conveying important information to a customer in a way that forces them to interact with and pay attention to your content. This use case employs a lightbox action triggered when a site visitor lands on a product detail page for a product that's currently out of stock.
Out-of-stock items are noted on the use case site by the oos_product
ID, which can be viewed using Google Chrome's Developer tools. Right-click the "Out of Stock" heading element, and then click Inspect.
Building the Custom 'Out of Stock' Target
After you find the site element that you can target, you can build a target in Target Builder to locate this site element and then target an experience whenever it finds the element on a page.
- Click COMPONENTS in the top navigation bar of the Monetate platform, and then select Targets.
- Click CREATE TARGET.
- Navigate to a page on your site that contains an out-of-stock product. In Target Builder, click the HTML Element tab and then click Element Content (text).
- Use the element selector to find the "Out of Stock" selector, and then click the forward arrow.
- On the Details tab, input
Out of Stock
into Element Content and leave the selector set to EQUALS so that the target only triggers when that exact text is present on the page. - Because this target should work on any page on your site, no conditions are necessary. Click the forward arrow.
- Give the target a title, a description, and a subcategory, and then click CREATE & EXIT.
Building the Experience
After you build the target, you can build an experience that uses it.
When creating the new experience, click WHO, and then click ADD TARGET. Next, click Custom Targets, click the target that you created, and then click SAVE to add it to the WHO settings of the experience.