Upgrading from Recipes V1

Merch Jar Formulas is the next evolution of our powerful Recipes automation engine. If you're familiar with our legacy Recipes V1 system, this guide will help you understand the key differences and leverage the powerful new features available in the updated syntax.

While the core goal remains automating actions based on data, the Formulas (V2) syntax offers significantly more flexibility, power, and clarity. Migrating your existing V1 logic involves rewriting it using the new syntax, but the benefits – like comparing time periods, using variables, and performing math – unlock much more sophisticated automation potential.

Key Syntax Changes: V1 vs. V2

1. Time Periods: The Biggest Change

The most significant difference is how time periods are handled.

V1: Used over the last X days (...) or over the lifetime (...) blocks, grouping conditions within that timeframe. Static properties were often checked within these blocks.

V2: Time periods are applied directly to time-based properties using parentheses (). Static properties are used without time periods. Conditions across different timeframes are combined using standard and/or.

Side-by-Side Examples

Simple Time-based Condition:

over the last 30 days clicks > 10   // V1
clicks(30d) > 10                    // V2

Multiple Conditions (Same Period):

over the last 14 days (acos > 40% and spend > 20.00)   // V1
acos(14d) > 40% and spend(14d) > 20.00                 // V2

Multiple Conditions (Different Periods):

(over the last 7 days clicks = 0) and (over the last 30 days spend > 15.00)   // V1
clicks(7d) = 0 and spend(30d) > 15.00                                         // V2

Static + Time-based Condition:

over the last 30 days orders > 1 and state = "enabled"   // V1
orders(30d) > 1 and state = "enabled"                    // V2

Lifetime Condition:

over the lifetime orders = 0   // V1
orders(..) = 0                 // V2

2. Boolean Logic (and, or) & Grouping (()):

V1: Often required explicit parentheses () when mixing AND and OR within the same over the... block.

V2: Allows mixing and and or freely. Remember that and has higher precedence (is evaluated first). Use parentheses () to control the order of operations explicitly for clarity, especially in complex expressions.

Example: (state = "enabled" and clicks(7d) > 5) or acos(30d) > 60%

Introducing Powerful New V2 Features

V2 syntax allows you to do things that were difficult or impossible in V1:

Compare Time Periods

Directly compare performance metrics across different date ranges.

V2 Example:

// Check if sales dropped compared to previous month
sales(30d) < sales(30d..60d)

Learn more about Time Periods

Math Operations

Perform calculations directly in your formula.

V2 Example:

// Check if bid is below 110% of 7-day CPC
bid < cpc(7d) * 1.1

Learn more about Math Operations

Variables & Custom Properties

let spend_threshold = 20.00;
let high_acos = 50%;
spend(30d) > spend_threshold and acos(30d) > high_acos;

Learn more about Creating Custom Properties

Conditional Logic

Implement if/then/else logic.

V2 Example:

// Assign a performance tag
let tag = case(
   acos(14d) < 25% => "Good",
   else "Poor");

Learn more about Conditional Logic

New Properties

Most metric and property names remain the same between V1 and V2 (e.g., clicks, sales, spend, acos, state, bid, budget).

New in V2: Key additions include target acos, match type, and last bid change, last budget change

Refer to the Syntax Reference for the complete list of V2 properties.

Tips for Rewriting Your V1 Recipes

  1. Identify the Goal: What was the original V1 recipe trying to achieve? (e.g., Pause bad keywords, increase bids on good targets).
  2. Select V2 Dataset: Choose the appropriate Source Dataset (Campaigns, Keywords, etc.).
  3. Translate Conditions: Rewrite each V1 condition using the V2 syntax:
    • Replace over the last X days (...) with property(Xd) ....
    • Ensure correct use of time periods for time-based properties.
    • Combine conditions using and / or. Use () for clarity.
  4. Leverage V2 Features: Consider if let, case, math operations, or time period comparisons can simplify or improve your original logic.
  5. Configure Workflow: Set up the corresponding Action and Schedule separately. Use "from variable" in Actions if you defined Custom Properties with let.
  6. Test: Use the Composer's validation and preview the Segment results carefully before activating automation.

Migrating takes some effort, but the increased power and flexibility of the Formulas (V2) syntax unlock far more sophisticated analysis and automation for your Amazon Ads. Don't hesitate to consult the detailed documentation pages and the Syntax Reference.

PREVIOUS ARTICLE
NEXT ARTICLE