> Every Dollar's Job · Make It Categorize Itself # TagMatcher Rules ## The Problem Sorting a month of transactions by hand takes an hour you do not have, and you will sort the same coffee shop differently in March than you did in February. Auto-sync apps solve this with a black box that guesses. You get speed and lose the ability to see why anything was labeled the way it was. TagMatcher is the middle path. You write a small set of plain rules. The app applies them the same way every time, in the order you chose. ## How a Rule Works A rule has three parts: - **Pattern to Match:** text to look for in the transaction description, like `STARBUCKS`. - **Matching Method:** *Contains* (the description has that text anywhere in it) or *Equals* (the description is exactly that text). - **Assign to Tag:** the category the transaction gets when the rule matches. Rules are checked from the top of the list down. **The first rule that matches wins.** That one sentence explains every tricky case below. Start with *Contains*. Bank descriptions are messy: `STARBUCKS #1234 SEATTLE WA`, `SQ *STARBUCKS`, `STARBUCKS COFFEE`. One *Contains* rule for `STARBUCKS` catches all of them. Use *Equals* only when a short pattern would match things it should not. ## Try It: Write Your First Rule Demo data ships with a starter set of rules. Add one of your own. 1. **Navigate:** user menu → Settings → Tag Matchers 2. **Verify:** a list of existing rules is shown, each with a pattern, an operator, and a tag 3. **Click:** "New Tag Matcher" 4. **Type:** Pattern to Match — PEETS COFFEE 5. **Select:** Matching Method — Contains 6. **Select:** Assign to Tag — Coffee Shops 7. **Select:** Position — Add to end (lowest priority) 8. **Click:** "Save" 9. **Verify:** the new PEETS COFFEE rule appears at the bottom of the list From now on, every imported transaction whose description contains PEETS COFFEE gets the Coffee Shops tag. (The starter set already covers STARBUCKS, which is why this one uses a different merchant — write rules for the merchants your own statements actually show.) ![Writing a new TagMatcher rule](/videos/learn/every-dollars-job/module-4/tagmatcher-rules/write-your-first-rule.webm) ## Priority: Specific Before General Two rules can match the same transaction. `AMAZON PRIME MONTHLY` contains both `AMAZON` and `AMAZON PRIME`. If the `AMAZON` → Shopping rule sits higher in the list, your Prime membership gets filed as shopping. The fix is order. Put specific rules above general ones: ``` 1. Contains "AMAZON PRIME" → Online Services 2. Contains "AMAZON" → Shopping ``` Now `AMAZON PRIME MONTHLY` hits rule 1 first and stops there. Plain `AMAZON.COM` misses rule 1 and lands on rule 2. On the Tag Matchers page, the up and down arrows next to each rule move it in the list. That list order is the priority. ## Three Cases You'll Hit **Same store, different spellings.** `WALMART`, `WAL-MART`, and `WAL MART` are the same store to you and three different strings to the app. Write three *Contains* rules, all assigned to Groceries. Any spelling gets sorted right. **A pattern that is too short.** *Contains* `TARGET` matches the store. It also matches `TARGET MARKETING INC` on a paycheck deposit. Make the pattern longer (`TARGET STORE`, or `TARGET T-` if your bank prints store numbers that way) or switch that rule to *Equals*. **One merchant, two categories.** Most `AMAZON` charges are shopping, but Prime is a membership. That is the priority case above: specific rule first, general rule after. ## Try It: Fix a Priority Problem 1. **Navigate:** user menu → Settings → Tag Matchers 2. **Click:** "New Tag Matcher" 3. **Type:** Pattern to Match — AMAZON PRIME 4. **Select:** Matching Method — Contains 5. **Select:** Assign to Tag — Online Services 6. **Select:** Position — Add to beginning (highest priority) 7. **Click:** "Save" 8. **Verify:** the AMAZON PRIME rule is at the top of the list, above any rule that matches AMAZON alone ![Adding a higher-priority rule above a broader one](/videos/learn/every-dollars-job/module-4/tagmatcher-rules/fix-a-priority-problem.webm) ## Building a Full Rule Set You do not need a rule for everything. Aim for the merchants that show up every month. Twenty to fifty rules usually cover 90% of transactions. Here is the order of work: 1. Sort your transactions by description and list the merchants that repeat. 2. Group them by the tag they should get. 3. Write one *Contains* rule per merchant, specific patterns first. 4. Import a file, scan the results, and fix the misses with a new rule or a reorder. Then leave it alone. Add a rule when a new merchant shows up. Reorder when something lands in the wrong tag. That is the whole maintenance job. Your rules always beat any category your bank's CSV may carry. --- **Key Takeaway:** TagMatcher rules are yours to read, edit, and reorder. Start with *Contains* rules for your regular merchants, put specific patterns above general ones, and remember: the first rule that matches wins. ## Check Your Understanding 1. A description reads `AMAZON PRIME MONTHLY`. Rule 1 is Contains `AMAZON` → Shopping. Rule 2 is Contains `AMAZON PRIME` → Online Services. Which tag does it get, and why? **Answer:** Shopping. Rules are checked top to bottom and the first match wins. Rule 1 matches first. To fix it, move the `AMAZON PRIME` rule above the `AMAZON` rule. 2. When should you use *Equals* instead of *Contains*? **Answer:** When a short *Contains* pattern would match transactions it should not, and the description you want is always exactly the same text. 3. How do you change a rule's priority? **Answer:** Use the up and down arrows on the Tag Matchers page to move it in the list. List order is priority. When creating a rule, you can also choose "Add to beginning" or "Add to end." 4. How is this different from an auto-sync app's categorization? **Answer:** Every rule here is one you wrote and can see. It applies the same way every time. An auto-sync app labels merchants with a model you cannot inspect or correct. --- [Import & Match Your Bank](https://budget.gnar.li/learn/every-dollars-job/module-3/import-and-match-your-bank.md) [Create Your First Budget](https://budget.gnar.li/learn/every-dollars-job/module-5/create-your-first-budget.md)