Skip to main content

Sync Xero tracking categories and account codes

How Xero’s analysis data flows into Prospect CRM, and how to get the most out of it.

Written by Heather

Xero uses two related concepts to slice financial data:

  • Account Codes: chart-of-accounts entries that revenue and costs post to.

  • Tracking Categories: free-form tags such as Region, Department or Product Line that you attach to invoice lines.

Both are useful when you want to report on sales at a more granular level than customer or product.


Account codes

Every Xero Item record has a default Sales Account Code and a default Purchase Account Code. These are the chart-of-accounts entries that revenue or cost posts to when the item is sold or purchased. When the integration imports your Xero items, it brings these codes through.

Field in CRM

Where it comes from

Sales Analysis

Imported from each item’s Sales Account Code in Xero. Used to drive revenue reports in the CRM grouped by analysis code.

Purchase Analysis

Imported from each item’s Purchase Account Code in Xero. Used by reports that break down cost-of-sales analysis codes.

Per-line account codes on invoices

When a Xero invoice is imported, each line’s account code is also imported into the Sales Transaction’s Analysis 1 field. This means that if a line is ever posted to a non-default account code in Xero, the CRM picks that up too.

Account codes flow back to Xero

When the CRM creates a new product in Xero via the Product Creator, the Sales Analysis and Purchase Analysis fields are pushed across as the item’s default Sales and Purchase account codes. When the CRM creates an invoice in Xero on order confirmation, each line carries its account code through, so revenue lands in the right account from the moment the invoice is created.


Tracking categories

Xero supports up to two tracking categories per organisation, typically used for Region, Cost Centre or Department, each with a list of options. Tracking categories can be attached to a contact, so every line on every invoice for that contact inherits them, or to individual invoice lines.

Contact-level tracking

When the CRM creates a new customer in Xero, the contact-level tracking categories from your template ledger are copied across to the new customer. This is the easiest way to make sure every new customer’s transactions land in the right tracking bucket without your accounts team having to set them up manually.

To set this up:

  1. Pick a Xero contact whose tracking setup represents a typical new customer.

  2. Configure that contact as your template ledger during integration setup.

New customers created from the CRM will inherit those categories on creation.

📌 Note: On update, the CRM doesn’t overwrite tracking categories on existing Xero contacts. Your accounts team’s configuration is preserved.

Line-level tracking

If your accounts team applies tracking categories to individual invoice lines rather than at the contact level, those line-level values are stored on the Xero invoice but are not currently surfaced into the CRM as separate analysis fields. The CRM imports each line’s account code into Analysis 1, but line-level tracking categories don’t currently flow into Analysis 2 or Analysis 3.

📌 Note: If line-level tracking visibility in the CRM matters to your reporting, this is currently a gap. Contact-level tracking inheritance via the template ledger covers the most common reporting scenario. If your business splits revenue across tracking categories on a per-line basis, you’ll need to run that reporting in Xero rather than in the CRM.


Xero as a secondary connection

Some businesses run their primary CRM integration to an inventory management system (such as Unleashed) and use Xero only for accounting. In that setup, the CRM connects to the inventory system as primary and Xero as secondary. The secondary Xero connection is specifically designed to enrich CRM data with Xero-specific values that the inventory system doesn’t have. For example, customer-level analysis codes from Xero contacts are imported onto the matching CRM customer records.

To enable this, configure the Xero connection with a secondary suffix during setup. See Setting up integration to Xero for the full walkthrough.


Tips for getting the most out of analysis sync

  • Set Sales and Purchase Account Codes on every Xero item. Items with no default account code end up with blank Analysis fields in the CRM, which makes report grouping painful.

  • Be consistent with your Xero chart of accounts. The CRM imports whatever codes you use. If your accounts team renames or splits codes mid-year, your CRM analysis reports will reflect that split.

  • If you use tracking categories at the contact level, configure your template ledger so new customers inherit them automatically. This is the highest-leverage setup step for businesses that rely on tracking-based reporting.

  • If you use tracking categories at the invoice line level, plan for that reporting to live in Xero rather than the CRM. Most teams do it this way, since Xero already has those reports built.

Did this answer your question?