X (Twitter) ad spend and ROAS, read by itself
Connect X once and give each ad account to a project. Every night Sumly reads what each campaign spent on X, so ROI shows what it cost and what the people it brought paid.
What you get
What each X (Twitter) campaign spent, read every night, next to what the people it brought paid.
Three steps
Sumly only asks X's Ads API for reports: it never changes a campaign, an ad or a budget.
-
1
On Costs › Ad spend, press Connect X Ads and allow Sumly with the X account that runs your ads.
-
2
Pick the project each ad account is for and how far back the first read goes, up to two years.
-
3
Add
utm_source=x&utm_medium=paid&utm_campaign=and the campaign's name to each ad's website link, so each campaign meets its visitors. Untagged clicks still count for the X Ads source by X's click id.
Or let your coding assistant do it
Paste this into Claude Code, Cursor or Codex in your project. It fits the code to how your project is built, asks you for the dashboard steps and leaves the keys to you.
See what it says
Set up X Ads for Sumly in this project. Sumly (https://sumly.dev) shows revenue next to the visits and app users it came from. The full guide is https://sumly.dev/integrations/x-ads; read it if anything below is unclear. Steps: 1. On Costs › Ad spend, press Connect X Ads and allow Sumly with the X account that runs your ads. 2. Pick the project each ad account is for and how far back the first read goes, up to two years. 3. Add `utm_source=x&utm_medium=paid&utm_campaign=` and the campaign's name to each ad's website link, so each campaign meets its visitors. Untagged clicks still count for the X Ads source by X's click id. So each payment shows which visit it came from: A visit with X's click id (twclid, added to clicks on ads only) counts under the X Ads source. A campaign whose name or id the visits carry as utm_campaign counts for that campaign on ROI; the others count for the X Ads source. Keep in mind: Campaigns only, not ad groups or single posts. Days are the ad account's own, from midnight in its time zone. How to work: - Look at how this project is built first, and fit the code to its framework and its way of doing things; the examples above are a starting point, not something to paste as is. - Steps that happen in a dashboard (Sumly, or X Ads's own) are mine: tell me exactly what to click, then wait for me. - Keys the code needs belong in environment variables, never in the code or the repository. Never ask me to paste a secret key into this chat; tell me which variable to set. - Change only what this needs, show me the changes before you commit, and tell me how to check that it works.
What you see after connecting
X Ads next to every other project and provider, on the same pages.
Costs
One line per campaign, with the days read from X Ads.
ROI
What each campaign spent next to what the visitors it brought paid, its ROI and payback.
Home
Profit with the ad spend taken off.
Which campaign brought them
A visit with X's click id (twclid, added to clicks on ads only) counts under the X Ads source. A campaign whose name or id the visits carry as utm_campaign counts for that campaign on ROI; the others count for the X Ads source.
How attribution works →Counts toward your plan
Nothing: costs never count toward your plan. Plans →
What you don't get
No conversions from X's pixel and no changes to ads: Sumly counts the payments itself, from your payment provider.
The details
What is read
- Each campaign's billed spend, clicks and impressions by day, from the Ads API's analytics
- The ad account's name and its funding instrument's currency
When
- Every night, the last seven days again, as X settles billed spend over the first days.
- Read now on the Ad spend page, at any time.
- Costs stay in the ad account's currency and turn into euros at the European Central Bank's rate of each day.
- Each campaign and day is one cost, known by X's ids: read again it is updated, never added twice, and a line imported from an X Ads export for the same campaign and day is replaced.
Good to know
- Campaigns only, not ad groups or single posts.
- Days are the ad account's own, from midnight in its time zone.
X Ads questions
Does Sumly change my ads?
No. It only asks X's Ads API for analytics reports and the list of campaigns.
Why does a campaign show no visitors?
Its ads' links carry no utm_campaign that matches its name or id. Until they do, its spend counts for the X Ads source, which every click with X's click id arrives under.
I imported X Ads exports before. Will they double?
No. The day and campaign read from the account replace the imported line for the same campaign and day.
Does the connection run out?
No. X's access lasts until you disconnect here or take Sumly's access back in X's settings.
Other integrations
Try it with your own projects
Sign in with Google or a code by e-mail and connect your first project. The first 14 days of a paid plan are free, with no card.
Start freeOr look around first: open the live demo.