Why coding decides what the ledger can tell you
Every invoice and accrual is booked to a cost centre and a cost type, and the combination decides where it appears in the account. The marketing P&L guide explains both and makes the central point: errors in coding are the commonest reason marketing's view and the ledger differ. An agency invoice booked to a general cost centre disappears from marketing's total and turns up in someone else's. Media and agency fees booked together inflate media and hide the cost of service, which distorts customer acquisition cost (CACCost to acquire one new customer.) and every return figure built on it.
The guide to tracking spend against budget asks the tracker to use the ledger's codes so that extracts match. That only works if the codes reflect the way marketing needs to report. If finance offers one marketing cost centre and a single cost type called advertising, no amount of care in the tracker will let the ledger say what search cost against events, or what a launch cost in total.
Coding is also where the finance view and the marketing view of a campaign meet. Marketing names campaigns through the campaign taxonomy and tracking parameters; finance identifies cost through codes. When the two match, a report can join cost to results without manual work. When they do not, someone rebuilds the join by hand every month.
This tutorial is practice, not accounting. The chart of accounts, the cost centre structure, whether campaign or project codes exist and how the ledger is configured are finance's decisions and systems. Which costs sit in cost of sales, operating expense or as a reduction of revenue is the P&L guide's table, which it describes as company policy. Marketing's job is to ask for codes that support its decisions and then use them consistently.
Before you start
- Read the P&L guide. It is the prerequisite: cost centres, cost types and the common classification of marketing costs are explained there and not repeated here.
- Get the current codes from finance. Ask your finance business partner for the cost centres marketing books to, the cost types in use and any project or campaign codes, with a description of each.
- Pull a ledger extract. A recent closed period of marketing cost by cost centre and cost type, with supplier and description, shows how coding is actually done rather than how it is meant to be done.
- Have the tracker and the campaign taxonomy to hand. The tracker's budget lines and the taxonomy's attributes are what the codes must line up with. If there is no tracker yet, the tutorial on setting up a marketing budget tracker builds one that uses the ledger's codes. The guide to data operations and taxonomies sets out the campaign taxonomy and who owns it.
- Agree a session with finance. The mapping is agreed, not imposed; book time with the partner to settle it.
The steps
List what marketing buys by cost type
From the ledger extract, the tracker and the purchase ordersFinance's authorisation for a supplier to deliver against a named cost line, raised for the agreed amount before work starts and used to check the invoice., list everything marketing buys in a year and group it by kind: media bought directly, media bought through agencies, agency fees, freelance work, production, events and sponsorships, sampling and promotional items, software and data, research. Note which items need to be seen apart for marketing's decisions. Media and agency fees should always be separable, as the P&L guide explains; others, such as production against media, depend on what you report.
Agree the cost centres marketing books to
With finance, decide which cost centres marketing's spend goes to. Some companies use one; others split by team, brand, product range or region. The test is whether a split matches how budgets are held and decisions are made: a cost centre per product range helps if each range has its own budget and owner, and adds work for nothing if it does not. Note any marketing costs held in other cost centres, such as software in technology or salaries in a central people budget, so they can be shown alongside marketing's own.
Decide whether campaigns need their own codes
Some companies have project or campaign codes in the ledger; others do not. If they exist, agree which activity earns one. Large launches, events and programmes judged on their own return are the usual candidates; always-on channel activity often is not. If finance has no such codes, campaign detail stays in marketing's tracker, keyed to the purchase order, and the ledger reports by cost centre and type only. Either way, decide it once and write it down.
Match campaign codes to the campaign taxonomy
Where campaigns have finance codes, make each code traceable to the campaign's identity in the taxonomy: the same product, market and period attributes, and ideally an identifier both systems carry. Campaign names and tracking parameters stay with the operations and analytics pages; the UTM and naming conventions guide sets the rules, and the glossary defines a naming convention as an agreed pattern that reports can group reliably. This step only makes sure that the finance code and the campaign identifier point at the same thing, so cost and results can be joined.
Write the mapping table and share it
Put the outcome in one table: each kind of spend, its cost type, the cost centre or rule for choosing one, whether a campaign code is needed and an example. Add a short note on edge cases, such as sampling or event deposits, with finance's instruction for each. File it where everyone who raises orders or approves invoices can find it, give it an owner and a change log, and tell suppliers who invoice regularly which codes their invoices are booked to.
Code every order when it is raised
The cheapest place to get coding right is the order. When a purchase order is raised, it should carry the cost centre, cost type and any campaign code from the mapping table, so the invoice that follows inherits them. Ask agencies to invoice media and fees on separate lines, so each can be booked to its own cost type. An order raised without codes leaves the choice to whoever processes the invoice, who knows the least about what was bought. The tutorial on purchase orders and invoice approval covers the order itself, from request to closed order.
Check the coding when invoices are approved
The P&L guide notes that finance relies on the approver's knowledge. When an invoice reaches a marketing approver, check the codes as well as the amount: right cost centre, right cost type, right campaign code, media and fees split. Correct it before approval, which is far easier than correcting it after it is booked. Where an invoice covers something not on the mapping table, ask finance before approving and add the answer to the table.
Decide how costs that span several codes are booked
Some costs serve several cost centres or campaigns: an agency retainerA standing fee paid regularly to an agency or supplier for continuous work with a stable scope, as distinct from project fees, time and materials or commission. across ranges, a tool used by several teams, a shoot that produces content for two launches. Agree with finance whether such a cost is split across codes when it is booked, booked to one code and shared out in reporting, or held in a shared cost centre. The method for sharing such costs in marketing's reports is a separate decision, covered in the guide to allocating shared marketing costs; here, only settle where the ledger records it. The finance reporting hub shows how the two fit together.
Reconcile by code each month and fix errors at source
At month-end, compare the tracker with the ledger by cost centre, cost type and campaign code, not just in total. A total that matches can hide two errors that cancel out. For each difference, find the cause: a missing order, a wrong code on the order, an invoice coded differently from its order, or a gap in the mapping table. Ask finance to correct the ledger as it sees fit, and fix the cause so the same error does not recur. Where a difference has nothing to do with coding, such as an accrual never reversed or a cost finance books outside marketing's lines, the diagnosis for marketing spend not matching the ledger sorts it by kind with the rest of the gap. With few invoices in a month, read patterns over several months rather than one.
A marketing coding map
The mapping table is the output of the steps above. The layout below is a starting point to agree with finance; the cost types, cost centres and campaign code rules in it are examples, not a recommended structure.
| Spend | Cost type | Cost centre | Campaign code | Note |
|---|---|---|---|---|
| Media bought directly on ad platforms | Media | Team or range that owns the budget | Where the campaign has one | Billing currency and tax per finance's instruction |
| Media bought through an agency | Media | As above | Where the campaign has one | Invoiced separately from the agency's fee |
| Agency fees and retainers | Agency fees | As above, or per finance's rule for shared costs | Only if the fee is for one campaign | Never combined with media |
| Freelance work | Freelance or professional fees | Team that briefed the work | Where the work is for one campaign | Order raised before the work starts |
| Production | Production | Team or range | Where the asset is for one campaign | Phase payments coded to the same codes |
| Events and sponsorships | Events | Team or range | Usually yes | Deposits flagged to finance |
| Sampling and promotional items | Per finance's classification | Per finance's instruction | Where tied to a campaign | Classification is company policy |
| Software and data | Software | Marketing or a central technology cost centre | Rarely | Note if held outside marketing |
Once the map is in use, the cost lines in the marketing P&L template can be filled straight from the ledger by cost type, with the cost centre of each shown. Where marketing runs in several countries, the guide to measuring and reporting across markets covers the currency rule that sits alongside the codes. If the data team loads ledger extracts beside platform data, the guide to ad platform data in a warehouse shows how the campaign identifier becomes the key that joins them, and the guide to metrics layers and definitions keeps the cost measures built on those joins defined once. The KPI tree framework helps decide which key performance indicators (KPIA metric tied directly to an objective.) need cost at campaign level and which only need it by channel, which in turn tells you how fine the coding must be.
A food brand's coding map (illustrative)
Ebbanoor Foods agrees a coding map with finance
Ebbanoor Foods, an invented packaged food brand with three product ranges (cereals, snack bars and spreads), spends £1.9 million a year on marketing. Until this year every marketing invoice went to a single cost centre with two cost types, advertising and other. Marketing could not tell from the ledger what each range cost, and the agency's monthly invoice mixed media and fees.
The marketing operations lead and the finance business partner agree six cost types (media, agency fees, production, events, sampling and software), a cost centre per range plus one for shared brand activity, and a campaign code for each campaign above £50,000. Each campaign code carries the same range and launch-period values as the campaign taxonomy, so the snack bar launch is coded with the identifier its ad accounts and tracking parameters already use. The mapping table goes to everyone who raises orders, and the agency is asked to invoice media and fees on separate lines from April.
The first reconciliation by code, for April, matches in total but not by code. £14,000 of agency fees for the spreads range is booked to the cereals cost centre, because the order was copied from a cereals order and not changed. And £8,500 of in-store sampling for snack bars is booked as media, because the sampling supplier was set up in the system as a media supplier. Finance corrects both in the ledger; marketing adds a code check to its order template and asks finance to change the supplier's default cost type. May reconciles by code with one small difference, an invoice still in approval.
Common mistakes
- Leaving coding to whoever processes the invoice. They know least about what was bought. Code the order when it is raised.
- One cost type for all of marketing. It makes media and fees inseparable and every return figure wrong.
- More codes than decisions. A cost centre or campaign code nobody reports on is one more thing to get wrong on every order.
- Campaign codes that do not match the taxonomy. Cost and results cannot be joined, and someone rebuilds the join by hand each month.
- Reconciling only in total. Two coding errors can cancel each other out and hide in a total that matches.
- Correcting the tracker to match a wrong ledger. Fix the ledger through finance and fix the cause at source.
- Deciding classification in marketing. Whether a cost is cost of sales, operating expense or a reduction of revenue is company policy; ask finance and record the answer in the mapping table.
