---
title: "Tag products when a shopper views a sold out variant"
description: "When a shopper lands on a product page whose shown variant is sold out, add the tag restock-demand to the product. A demand signal for buying: these are the products people wanted and could not get."
canonical: "https://docs.workflow-trigger-extensions.app/template-tag-restock-demand"
---

# Tag products when a shopper views a sold out variant

When a shopper lands on a product page whose shown variant is sold out, add the tag restock-demand to the product. A demand signal for buying: these are the products people wanted and could not get.

One trigger, built-in Shopify actions only, no other app needed. Nothing in it is specific to a store, so it works as soon as it is imported.

![The workflow in Shopify Flow: Tag products when a shopper views a sold out variant](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/b27679a667341702.png)
*The complete workflow as it looks in Shopify Flow.*

## What it needs

- The app's permission **Storefront Behaviour Access + Inventory Data Access + Product, Variant & Collection Data Access**. See [Permissions and data access](https://docs.workflow-trigger-extensions.app/permissions-and-data-access.md).
- Nothing else: turning the workflow on switches the trigger **Out-of-Stock Variant Viewed** on in the app.

Install the Workflow Trigger Extensions app and grant Storefront Behaviour Access and Inventory Data Access and Product, Variant & Collection Data Access on its Permissions page. Turning this workflow on switches the trigger on in the app. This is a storefront trigger: events are only collected from shoppers who accept analytics cookies.

## Get the workflow

1. Download the `.flow` file attached at the bottom of this page.
2. In your Shopify admin open **Flow**, click **Import** and choose the file.
3. Check the steps, then click **Turn on workflow**.

The file is an export from Shopify Flow itself. Do not edit it by hand; change the workflow in Flow after importing it.

## How it works

1. **Out-of-Stock Variant Viewed** fires when a shopper lands on a product page whose shown variant is sold out.
2. **Add product tags** puts `restock-demand` on the product.

## Make it yours

- Sort buying decisions by this tag, or count the views in a metafield with a **Run code** step.

> [!NOTE]
> **Good to know**
> A storefront trigger: events are collected in the shopper's browser and only with analytics consent, so it under-reports by design. Switching it on also switches on Storefront Product Viewed, and every product view counts towards your plan. See [Storefront triggers](https://docs.workflow-trigger-extensions.app/storefront-triggers.md).

## Next steps

- [Storefront triggers, step by step](https://docs.workflow-trigger-extensions.app/storefront-trigger-tutorials.md) - every field this trigger sends, with more examples.
- [Workflow templates](https://docs.workflow-trigger-extensions.app/workflow-templates.md) - all templates.
- [Event history and troubleshooting](https://docs.workflow-trigger-extensions.app/event-history-and-troubleshooting.md) - check that the trigger fired.
