Skip to main content

Overview

The Aftersell dashboard provides a visual interface for building and managing Strategies. You can create strategies, define targeting rules with triggers, assign products to recommend, and configure catch all behavior - all without writing any code. This guide walks through the end-to-end process of creating a Strategy in the UI.
  1. Log in to Aftersell.
  2. Click Strategies in the left sidebar navigation.
  3. You’ll see a list of your existing Strategies, or an empty state prompting you to create your first one.

Creating a New Strategy

  1. Click Add Strategy.
  2. You’ll be taken to the Strategy editor where you can add rules.
Click the pencil icon in the top left of the Strategy editor to give your Strategy a descriptive name. A clear name makes it easier to identify strategies in the dashboard later.

Adding Rules

Each Strategy contains one or more rules. A rule consists of:
  • Triggers - the “when” - criteria that must be met for the rule to match.
  • Actions - the “then” - the experience returned when the rule matches.

Defining triggers

Triggers determine when a rule fires. You may combine up to five triggers in a single rule. One AND / OR toggle applies to the whole condition set: with AND, every trigger must match; with OR, any one trigger matching is enough. Available trigger types include:

Product triggers

Target based on the products in context (the shopper’s cart, the just-completed order, or the product being viewed):
  • Specific product(s) - matches specific Shopify products by ID
  • Collection - matches products belonging to specific collections
  • Tag(s) - matches products with specific tags (e.g., “sale”, “summer”)
  • Title - matches the product title
  • Vendor - matches the vendor/brand name
  • Type - matches the product type field (e.g., “Apparel”, “Electronics”)
  • Handle - matches the product URL slug
  • Metafield - matches on custom metafield namespace/key/value pairs
  • Selling plan - matches “subscription” or “one-time” products

Customer triggers

Target based on who the shopper is:
  • Customer tag - e.g., “VIP”, “loyalty-gold”
  • Country code - billing country
  • Province code - billing province/state
  • Locale - customer locale (e.g., “en-US”)
  • Accepts marketing - marketing opt-in status
  • Order count - number of previous orders
  • Total spent - lifetime spend

Cart triggers

Target based on the overall cart state:
  • Cart subtotal - e.g., subtotal greater than $50
  • Item count - total quantity of items in the cart
  • Line count - number of distinct line items
  • Cart attribute - custom cart attributes set via Shopify’s cart API
  • Cart note - the cart note field

Location triggers

Target based on where the shopper is shipping, and the store’s currency:
  • Shipping country - shipping destination country
  • Shipping province - shipping destination province/state
  • Shipping method - selected shipping method
  • Store currency - the active store currency code

Marketing triggers

Target based on how the shopper arrived:
  • UTM source / medium / campaign / content / term - attribution parameters

Time triggers

Target based on when the request is evaluated, in store time:
  • Day of week - the current day
  • Hour of day - the current hour

Dynamic triggers

  • Always match - a trigger with no condition that always fires. Use it to make a rule run on every request (this is distinct from the strategy-level Catch all, which only fires when no other rule matches).
Not every trigger is populated on every surface. Checkout, for example, only sends product and cart context - customer, location, and marketing triggers won’t match there. See the Implementing Strategies guides for what each surface sends.

Operators

Each trigger uses an operator to define how the value is matched. The operators available depend on the trigger type.
OperatorDescription
EqualsMatches when the field is exactly the value you specify - e.g., vendor equals “Nike”.
Does not equalMatches when the field is anything other than the value you specify - useful for excluding a specific product type or vendor.
Contains anyMatches when a multi-value field includes at least one value from your list - e.g., a product has any one of several collection memberships.
Does not contain anyMatches when a multi-value field includes none of the values in your list - e.g., exclude products tagged “final-sale”.
Contains allMatches when a multi-value field includes every value in your list - e.g., a product must have both the “sale” and “summer” tags.
Does not contain allMatches when a multi-value field is missing at least one of the values in your list.
ContainsMatches when a text field includes your value as a substring - e.g., title contains “Gift”.
Does not containMatches when a text field does not include your value.
Greater thanMatches when a numeric field exceeds your value - e.g., cart subtotal is greater than $75.
Less thanMatches when a numeric field is below your value - e.g., order count is less than 2 (first-time buyers).
Greater than or equal toMatches when a numeric field meets or exceeds your value - e.g., total spent is at least $500.
Less than or equal toMatches when a numeric field is at or below your value - e.g., cart item count is no more than 3.
Not every operator is available for every trigger:
  • List operators (Contains any / all and their negations) apply to multi-value fields like tags, collections, customer tags, and specific products.
  • Text operators (Equals, Contains, and their negations) apply to single-value text fields like title, vendor, handle, locale, country, and UTM parameters.
  • Numeric operators apply to fields like cart subtotal, item count, line count, order count, total spent, and hour of day. Numeric operators have no “does not” variants.
  • A few fields support only Equals - selling plan, day of week, and accepts marketing.

Defining Actions

Actions create the experience you want to deliver to the customer. This is where you decide what products to surface, how to surface them, and any additional data to pass alongside them. A rule can have multiple actions configured together to build out the full experience. Per rule, all configured actions contribute to one combined pool. For example, a rule with a specific product action, a collection action, and a tag-based action will return products from all three sources together. If a product matches multiple sources, it is deduplicated.

Product actions

The same product attributes available on the trigger side are also available when defining actions. You can return products based on:
  • Specific products - hand-pick individual products from your Shopify catalog.
  • Collection - return all products belonging to a specific collection.
  • Product attributes - return products matching criteria like tags, vendor, product type, or metafields - the same attribute types used in triggers.

Dynamic actions

Dynamic actions change what is returned based on real-time signals rather than a fixed product list. Available dynamic action types include:
  • Most popular - your store’s best-performing products by sales volume, either store-wide or scoped to a collection.
  • Recently purchased - products recently purchased across the store.
  • Inherit from when - reuse the rule’s own triggers (the “when”) as the product selector, so the products returned match the same criteria the rule fired on.
  • AI Recommendations - personalized suggestions generated by Aftersell’s recommendation model.

Filtering actions

Once the product pool is assembled, you can configure how many products are returned and in what order:
  • Sort - control which products are selected:
    • Random - a random selection.
    • Price: high → low - most expensive products are returned first.
    • Price: low → high - least expensive products are returned first.
  • Amount/Limit - set the maximum number of products to return.
Sort is applied first, then Amount/Limit. For example, if your sort is set to Random, the full product pool is randomized before the limit is applied - so you always get a random slice, not the same products in a random order.

Key-value actions

Optionally, attach key-value pairs to a rule. When the rule matches, these are returned in meta.data in the API response alongside the product results. Common uses include:
  • Promotional banner text
  • Campaign labels for analytics
If multiple rules match and emit the same key, the value from the first matching rule wins - later rules cannot override it.

Rule Priority and Evaluation Order

Rules within a Strategy are evaluated in hierarchical, sequential steps. Step 1 is evaluated first, and so on. You can reorder rules by dragging and dropping them in the Strategy editor. The evaluation engine:
  1. Evaluates each rule’s triggers against the provided context.
  2. Collects products from all matching rules.
  3. Deduplicates and limits the result to the configured maximum (default: 20 products).

Configuring a Catch all

Catch all is a special rule that acts as the final step in every Strategy evaluation. It has no trigger, it fires automatically if no other rule in the Strategy matches the current request. When enabled, the Catch all ensures your recommendation slot is never empty. Its action can be configured using any of the same action types available to regular rules - specific products, collections, dynamic actions, etc.
  • Enable/disable - toggle the Catch all rule on or off for the Strategy. When disabled, requests that match no rules will return empty.
  • Configure actions - define what to return using any combination of available action types, the same as any other rule.
When the Catch all fires, the API response will indicate resolution.fallbackUsed: true.

Global Filters

Global filters remove products from selection eligibility across every rule in a Strategy. You can access them via the filter icon next to the strategy name at the top left of the Strategy editor. Available global filters:
  • Exclude out of stock - automatically exclude any product that is currently unavailable for purchase.
  • Exclude input products - exclude the product(s) that triggered the rule (e.g., the product a shopper is currently viewing on a PDP), so you never recommend the same product the shopper is already looking at.
  • Exclude by product tag - exclude products carrying specific tags.
  • Exclude by metafield - exclude products matching a specific metafield namespace/key/value.
  • Exclude by product ID - exclude specific products by ID.
  • Require stock at location - keep only products that have available inventory at a chosen location (requires inventory and location read permissions).

Validation and Error States

A Strategy cannot be saved if any rule is incomplete. Each rule needs at least one condition (or the Always match trigger) and at least one action; if either is missing, errors will appear directly on the rule in question highlighting what needs to be resolved. To clear the error and save the Strategy, either:
  • Complete the rule - add the missing trigger and/or action.
  • Delete the rule - remove it entirely if it is no longer needed.
The Strategy editor will not allow saving until all rules are valid.