Keitaro Cost Import: Facebook Ad Spend Into Your Tracker
The case for Keitaro cost import is simple: ad spend in the tracker turns it from a conversion counter into a profit calculator: with spend in the reports, every campaign row shows ROI instead of payouts alone. Keitaro ships this as a dedicated integration - Facebook Costs - that imports costs from an ad account on a schedule, converts them into the tracker's currency, and posts them into campaign reports. This guide walks the setup end to end: how the integration differs from conversion sending, the exact fields it needs, the one campaign parameter that silently decides success, and the troubleshooting list for when costs refuse to appear.
The money-frame around this setup - why tracker ROI and platform ROAS disagree - is in the tracker ROI vs ROAS guide; here the focus is the plumbing.
What the Facebook Costs Integration Is
Keitaro's documentation is explicit about the boundary: the integration "imports costs from a Facebook Ads ad account to Keitaro," and "the cost integration is separate from the conversion sending integration" (Facebook Costs documentation). Two integrations, two credentials, two jobs: Facebook Conversions sends your conversions out to Meta; Facebook Costs pulls spend in.
Spend lands in campaign reports, which is where it becomes useful: per-campaign and per-source profitability, honest per-offer comparisons, and the tracker ROI denominator from the money reconciliation guide. The cost parameter in the postback contract covers per-conversion cost models; the integration covers the ad-account spend that never travels through postbacks.
The Setup: Fields That Matter
The documented setup sequence:
- Open Integrations, select Facebook Cost, click Add account.
- Fill the fields: Name for the integration label; Choose campaigns - the Keitaro campaigns to update; Ad account ID copied from Facebook Ads Manager; Access Token for the API connection; the Facebook API version; Update every - the automatic refresh interval; and Use proxy for routing the requests.
- Save - and note that the integration list also offers Pause, Resume, Clone, Delete, and a manual Update costs button for an immediate refresh.
One field deserves its own minute - the token. Per the docs: in Facebook, create an app (Other, then Business type), enable Marketing API in the app settings, open Tools, tick the boxes, and generate the token to copy into Keitaro (Facebook Costs documentation).
The {{adset.id}} Requirement
Under the hood, the integration maps Facebook's spend data onto Keitaro campaigns through campaign parameters, and the ad set identifier is the load-bearing one: {{adset.id}}. The documentation states the failure mode verbatim: "If campaign parameters are empty or differ from the template, costs are not recorded."
In practice that means three places must agree:
- The Facebook campaign's URL parameters carry the template macros - at minimum the ad set identifier.
- The tracker campaign's parameter columns are set to receive them.
- For remote-hosted sites (KClient PHP, the tracking script, the WordPress plugin), the tags travel onward in the site URL, and through apps the parameters pass along the chain - the documentation shows
sub1={{adset.id}}into the app, thensub1={sub1}into Keitaro.
When costs silently never appear, this parameter chain is the first suspect - before tokens, before API versions.
Schedule and Currency
Updates run per the interval in Update every, and coverage is documented: each update "updates costs for the last 5 days," while "the first update covers 30 days." Currency handling is automatic on the tracker side: Keitaro pulls the currency from the Facebook account and converts it into the tracker's currency, so your reports show the tracker's base currency either way.
One reporting consequence from the reconciliation guide applies directly: spend updates are periodic, so same-hour ROI comparisons can mix a fresh revenue row with yesterday's spend row. Compare on settled periods, never on the live edge.
Troubleshooting: When Costs Do Not Appear
For missing costs, the documented checklist runs:
- "Integration is not tied to a campaign" - no Keitaro campaign was selected in the integration; add one and save.
- Parameters empty or different from the template - costs are not recorded; restore the
{{adset.id}}chain from the section above. - Version mismatches - the Keitaro version and the Facebook API version in the integration both need to be current.
- Token problems - the Marketing API token must be live and copied fully.
- Region access - the proxy option exists for reaching specific regions and reducing block or captcha risk on frequent automated requests.
On the platform-side leg of the picture - what Meta actually counted - Pixel Activator and Test Events cover verification, while the postback checklist handles the conversion half of the books.
Importing Facebook Ad Spend: Frequently Asked Questions
Frequently asked questions
Sources
Sources
- Verify the revenue half: Pixel Activator fires free test events while you wire the spend side.
- Both books, one system: Most keeps conversions flowing while your spend imports itself.
