AI Analyze Step
Use AI to analyze your stats data and produce named variables based on a plain-English instruction.
What it does
The AI Analyze step passes your stats data to AI (Claude or Gemini) along with a natural language instruction. The AI reads the data and produces a set of named variables — identifying top performers, flagging anomalies, computing custom metrics, or preparing data for a downstream bulk update — that you can then use in emails, conditions, tracker edits, and more.
When to use it
- Find the top 3 affiliates by revenue without manually sorting
- Flag affiliates whose EPC dropped significantly from the previous period
- Calculate a custom metric like total payout across all affiliates
- Compare two Pull Stats datasets and identify discrepancies
- Prepare
id:costpairs for a Bulk Cost Update after comparing tracker data to your own records - Summarize performance in a sentence for an executive-style email
Configuration
Instruction
Write a plain-English instruction describing what you want the AI to do with the data. Be specific about the output you need.
Good instructions:
Find the top affiliate by revenue. Return their name and revenue.
Compare campaign costs between Pull Stats 1 and Pull Stats 2. For each campaign that appears in both, check if the Cost values differ. Return id:cost pairs as a single comma-separated string (e.g. "101:50.00,102:25.50") ready for bulk cost update.
List all affiliates with fewer than 5 conversions this week. Return their names as a comma-separated list and count how many there are.
Less useful instructions:
Analyze the data
Find patterns
The more specific you are — naming exact columns, specifying the output format — the more reliable the results.
Smart Enhance
Click Smart Enhance to automatically rewrite your instruction to be more precise. The AI reads your dataset schemas (column names and stat types from previous Pull Stats steps) and rewrites the instruction with explicit column references, formulas, and disambiguation.
Smart Enhance costs 1 AI credit and may ask one or two clarifying questions before rewriting.
Use Smart Enhance when you get unexpected results or when your instruction references columns by informal names. It often catches ambiguities that cause the AI to pick the wrong column.
Variable Name Prefix
All generated variables will be prefixed with this value. Default is ai, which produces variables like {ai_top_affiliate} and {ai_revenue_total}.
You can change this to any lowercase alphanumeric string. For example, a prefix of compare would produce {compare_discrepancies_found}.
AI Model
Choose the model quality tier for this step:
| Tier | Credits per run | Best for |
|---|---|---|
| Basic | 1 | Simple lookups: finding a max value, extracting a single field, counting rows |
| Advanced | 2 | Multi-step analysis: cross-dataset comparisons, conditional logic, formula-based metrics |
| Expert | 4 | Complex reasoning: multi-dataset joins, nuanced deduplication, edge-case handling |
When in doubt, use Advanced (the default). Use Expert only for instructions with many conditions or cross-dataset logic that Advanced handles incorrectly.
Output Variables
The AI produces named variables, each with:
- A name in snake_case (e.g.
cost_update_pairs,low_epc_count) - A value (always a text string)
- A description of what it represents
These variables appear after running the preview and are available to every downstream step.
Example — finding top affiliate:
{ai_top_affiliate} → "Acme Media"
{ai_top_affiliate_revenue} → "12453.50"
Example — bulk cost update preparation:
{ai_cost_update_pairs} → "101:50.00,102:25.50,103:75.00"
{ai_campaigns_compared} → "8"
{ai_cost_discrepancies_found} → "3"
All variable values are text strings, even numbers. If you use them in a Condition Check (e.g. comparing {ai_low_epc_count} to a number), AffZero handles the type conversion automatically.
Paired data for bulk operations
When a downstream step (like Bulk Cost Update) needs id:value pairs, ask the AI to return a single variable with the pairs already combined — not two separate lists.
Wrong approach (breaks downstream substitution):
Return campaign_ids_to_update (comma-separated IDs) and new_costs (comma-separated costs)
If you do this and write {ai_campaign_ids_to_update}:{ai_new_costs} in the Bulk Cost Update field, you'll get 101,102,103:50.00,25.50,75.00 — a broken format.
Correct approach:
For campaigns where costs differ, return a single variable with id:cost pairs
ready for bulk update (e.g. "101:50.00,102:25.50").
This produces {ai_cost_update_pairs} → "101:50.00,102:25.50" which maps directly to the Bulk Cost Update cost_entries field.
Previewing results
Click Run Analysis Preview inside the step editor to test your instruction against the current Pull Stats data. The AI response and variable list will appear immediately, showing each variable's name, description, and the sample value.
Long values (like a list of many IDs or pairs) show a preview with an expandable toggle — click Preview value to see the full content.
After the first preview run, variable names are locked. Clicking Re-run re-executes the analysis but keeps the same names, so downstream steps that reference {ai_top_affiliate} continue to work. Use Reset names only if you intentionally want to change the output structure.
Tips for better results
- Name specific columns: "sort by the Revenue column" is better than "sort by performance"
- Ask for specific output: "return the affiliate name and their payout" is more reliable than "tell me about the top affiliate"
- For paired bulk operations: always ask for pre-paired
id:valueformat rather than two separate lists - For lists: ask the AI to return them as comma-separated values
- Limit scope: "find the top 3" produces cleaner output than "rank all affiliates"
- Use Smart Enhance if you're not sure whether your column names are unambiguous
AI Credits
Each use of the AI Analyze step consumes AI credits based on the selected tier (1, 2, or 4). Credit usage is shown next to the Run Analysis Preview button. Check your monthly usage and limits in Settings → Usage.
| Plan | AI Calls / Month |
|---|---|
| Free | 100 |
| Starter | 500 |
| Pro | 2,000 |
| Scale | 5,000 |