Auto-tagging & Sale Collection (how it works)
How discounted items get tagged and automatically organized into a clearance collection.
Show all sections (29)
- What StockSweep changes in Shopify
- Product tags
- Smart Collection
- Collection settings page
- Live status panel
- Tag cleanup rules
- Remove on revert
- Remove on sale
- Daily cleanup job (automatic)
- Why auto-tagging matters
- Verify (what success looks like)
- 1. Apply a test discount
- 2. Confirm tags in Shopify
- 3. Confirm collection membership
- 4. Confirm storefront visibility
- 5. Revert and confirm cleanup
- Troubleshooting (symptom-first)
- "Discount applied but item didn't appear in the sale collection"
- "Tag was added but the collection doesn't show the product"
- "Reverted the discount but the product is still in the collection"
- "Products from other sources appear in my clearance collection"
- FAQ
- Can I use a tag I already use for other purposes?
- What if I disable auto-tagging after some products are already tagged?
- Can I have multiple sale collections?
- Related articles
StockSweep keeps your sale page updated automatically. When you discount dead stock, the app tags the product in Shopify so it appears in your clearance collection — and removes the tag when the discount is reverted or the item sells.
Estimated time: 6–8 minutes
What you'll accomplish
- Understand the full flow: discount → tag → collection → revert → cleanup
- Know exactly what StockSweep changes in Shopify (tags and collection rules)
- Configure collection settings (tags, cleanup rules, auto-create vs. existing)
- Verify the setup with a small test
Requirements
- You apply discounts through StockSweep (see Apply Discount)
- You have (or want to create) a Shopify collection to display sale/clearance items
High-level flow
1. You apply a discount in StockSweep
↓
2. StockSweep adds the configured tag (default: "clearance") to the product via Shopify API
↓
3. Shopify Smart Collection rule ("Product tag equals clearance") automatically includes the product
↓
4. Product appears on your clearance page on the storefront
↓
5. When the discount is reverted OR the item sells → tag is removed (based on cleanup rules)
↓
6. Product is automatically removed from the clearance collection
What StockSweep changes in Shopify
Product tags
When a discount is applied, StockSweep adds tags to the product via the Shopify Products API:
| Tag type | Default | Example | Purpose |
|---|---|---|---|
| Primary tag | clearance |
clearance |
Powers the Smart Collection rule — this is the tag that makes the product appear in your sale collection |
| Secondary tags (optional) | None | dead-stock, limited-time |
Additional tags for internal categorization or marketing segmentation |
Tag format rules: lowercase, no spaces, hyphens allowed (e.g., clearance, dead-stock, limited-time).
Smart Collection
StockSweep can either create a new Smart Collection or link to an existing one (recommended for SEO — see Connect Existing Collection).
If StockSweep creates a new collection on your first discount:
| Setting | Default value |
|---|---|
| Title | Clearance Sale |
| URL handle | clearance-sale |
| Rule | Product tag equals clearance |
| Published | Yes (visible on storefront) |
This gives you a permanent, SEO-friendly URL at /collections/clearance-sale.
Collection settings page
Go to Settings → Sale Collections to configure:
| Setting | What it controls |
|---|---|
| Auto-tagging toggle | Enable/disable automatic tagging when discounts are applied. When off, discounts still work but products are not added to sale collections. |
| Primary tag | The main tag that powers your collection rule (default: clearance) |
| Secondary tags | Optional additional tags added alongside the primary tag |
| Remove tag on revert | When enabled, reverting a discount removes the tag immediately |
| Remove tag on sale | When enabled, when a discounted item sells, the tag is removed |
| Collection mode | Auto-create a new collection OR link to an existing collection |
| Collection title | Display name for auto-created collection (default: "Clearance Sale") |
| Collection handle | URL slug for auto-created collection (default: clearance-sale) |
| Published | Whether the collection is visible on the storefront |
Live status panel
The settings page also shows a live status panel with:
- Product count — how many products currently have the clearance tag
- Last sync time — when the collection was last updated
- Direct link — link to view/edit the collection in Shopify Admin
Tag cleanup rules
StockSweep provides two configurable cleanup triggers:
Remove on revert
When you revert a discount, the primary tag is removed from the product immediately. The product disappears from the clearance collection.
Recommended: always enable this. You do not want reverted items appearing in your sale collection.
Remove on sale
When a discounted item sells, the tag is removed. The product disappears from the clearance collection.
Consider your preference:
- Enable if you want the clearance page to only show items that are still available
- Disable if you want to keep sold items visible for social proof (they will show as "Sold out" on the storefront)
Daily cleanup job (automatic)
In addition to the real-time cleanup triggers above, a daily background job runs at 4:00 AM to catch any orphaned tags — products whose discounts have been reverted or sold but whose tags were not cleaned up in real time (e.g., due to a transient API error). This ensures your sale collection stays accurate even if a real-time cleanup fails.
Why auto-tagging matters
| Benefit | How |
|---|---|
| Shoppers find deals faster | All discounted items are in one browsable collection |
| Clearance page stays fresh | Products are added/removed automatically as you discount and revert |
| Marketing-friendly | Promote a single permanent URL (/collections/clearance-sale) in emails, ads, and social media |
| No manual curation | You never need to manually add/remove products from the sale collection |
Verify (what success looks like)
Test the full cycle with a small batch:
1. Apply a test discount
Select 2–3 items from the Dead Stock Table and apply a small discount (e.g., 10%).
2. Confirm tags in Shopify
Open one of the discounted products in Shopify Admin → Products. In the Tags section, confirm the "clearance" tag (or your configured primary tag) is present.
3. Confirm collection membership
Open your sale collection in Shopify Admin → Collections. The discounted product should appear.
4. Confirm storefront visibility
Visit your clearance collection page on the storefront (e.g., yourstore.com/collections/clearance-sale). The discounted product should be visible with the "Was $X, Now $Y" strikethrough.
5. Revert and confirm cleanup
Revert the test discount. Then:
- Confirm the tag is removed from the product in Shopify Admin
- Confirm the product is no longer in the sale collection
- Confirm the storefront clearance page no longer shows the item
Troubleshooting (symptom-first)
"Discount applied but item didn't appear in the sale collection"
Likely cause: auto-tagging is disabled, collection is not rule-based (Manual Collection), or the rule tag does not match the tag StockSweep applies. Fix: go to Settings → Sale Collections and confirm auto-tagging is enabled. Open the collection in Shopify Admin and confirm it is a Smart Collection with the rule "Product tag equals [your configured tag]". How to confirm: the product has the tag in Shopify Admin AND the collection rule matches that exact tag.
"Tag was added but the collection doesn't show the product"
Likely cause: the Smart Collection rule uses a different tag than what StockSweep applies. Fix: compare the tag on the product (in Shopify Admin → Product → Tags) with the rule in your Smart Collection settings. They must match exactly (case-sensitive, no extra spaces). How to confirm: after matching the tag, the product appears in the collection.
"Reverted the discount but the product is still in the collection"
Likely cause: "Remove tag on revert" is disabled in collection settings, or the tag was also added manually outside of StockSweep. Fix: enable "Remove tag on revert" in Settings → Sale Collections. Check if additional tags are keeping the product in the collection. The daily cleanup job (4:00 AM) will also catch orphaned tags. How to confirm: the product tag is removed and it disappears from the collection.
"Products from other sources appear in my clearance collection"
Likely cause: other apps or manual actions are adding the same tag to products.
Fix: use a unique primary tag that is only managed by StockSweep (e.g., stocksweep-clearance instead of generic sale).
How to confirm: only StockSweep-discounted products have the tag and appear in the collection.
FAQ
Can I use a tag I already use for other purposes?
It is possible but not recommended. Sharing a tag with other systems can cause products to appear in or disappear from the collection unexpectedly. Use a dedicated tag for StockSweep clearance.
What if I disable auto-tagging after some products are already tagged?
Disabling auto-tagging stops future tags from being applied but does not remove existing tags. To clean up, either remove tags manually in Shopify Admin or re-enable auto-tagging and revert the discounts (which triggers tag cleanup).
Can I have multiple sale collections?
StockSweep manages one sale collection per store. If you need multiple collections (e.g., by category), you can create additional Smart Collections in Shopify using secondary tags.
Related articles
Was this article helpful?
Let us know — your feedback helps us improve our documentation.