Lab · At work · iBuy / 6ave.com
Read-only ads reporting
A server-side module that pulls Best Buy Ads (MyAds) reporting every day and, by design, cannot change a campaign.
- Status
- In production
- Who uses it
- The ads and listings team, through PublishOS’s Best Buy Ads tab, the phone app and a daily brief.
- Built with
- Node.js on Render · Upstash Redis · Chrome extension (Manifest V3) · Claude API for the daily brief
The allowlist gate
Allowlist · approved reporting calls · one at a time, paced
- campaign report · day✓ allowed
- product report · day✓ allowed
- keyword report · day✓ allowed
- change bid✕ Refused · cannot write
Audit log Example
- 06:00:04 · campaign report · 200 · 182 KB
- 06:00:09 · product report · 200 · 96 KB
- 06:00:15 · keyword report · 200 · 412 KB
Results read as attributed sales, never called orders.
The problem
There’s no server-to-server reporting access for MyAds, so ad performance had to be checked by hand in the portal. The team wanted daily data joined to their listings, with zero chance of an automated tool touching a live campaign.
How it works
Uses the existing sign-in
A companion Chrome extension passes the team’s portal session to the server. No password is stored.
Every completed day
Each morning it pulls the previous day per store (campaigns, products, keywords, placements, platforms) and catches up any missed days.
Allowlisted calls only
Every call is checked against a short list of approved reporting calls before it leaves the server; anything else is refused.
Paced and capped
Requests run one at a time with pauses; each run plans its request count first and stops if it overshoots.
Feeds the team’s tools
Windowed ad views, a to-do list, negative-keyword spreadsheets for a person to review, and a daily brief written by Claude that recommends actions and changes nothing.
Where AI fits
- Claude writes a short daily brief from the 7- and 30-day views: what changed, what to do, what to watch.
Guardrails
Cannot write
Write-type requests are refused outright. Nothing that changes campaigns, bids, budgets, keywords or products is reachable.
Logged
Every request is logged for audit: time, which call, status and size.
Honest wording
Results are “attributed units” and “attributed sales”, never orders.
Engineering notes
Storage limits
When the database filled up, keyword detail moved to a 7-day window that then rolls up, and large datasets are compressed (about 6.5× smaller), tested on a simulated full database before the live migration.
Memory limits
Keyword data is folded one day at a time and results are cached, because recomputing them was running the server out of memory.
One alert, not hundreds
Duplicate alerts are suppressed for six hours, so an expired sign-in sends one push.