Data to AI™ / Gemini/Facebook Ads

Query Facebook Ads from Gemini CLI and Code Assist

Pull Meta ad spend, placement and audience figures into your terminal or VS Code while you build notebooks, scripts and dashboards, without dropping another Ads Manager download into the project.

Better answers, fewer tokens.

  • Lower AI costs for the same work
  • More accurate, reliable answers
  • Read-only
  • Uses the Facebook Ads data you already sync
  • SOC 2 Type II certified
Gemini CLI
Connected to Dataddo

Which placements returned the most purchase value per dollar spent last month?

Gemini Answer · Facebook Ads

Instagram Reels returned 4.1 in purchase value per unit of spend, the best of the three, on about a third of the budget. Facebook Feed took the largest share at 3.2.

PlacementSpendPurchase RoasCtr
Instagram Reels Platform Position Device Ad Insights $8,4004.11.32%
Facebook Feed Platform Position Device Ad Insights $12,6003.21.05%
Instagram Stories Platform Position Device Ad Insights $5,2002.40.71%

Spend and Purchase Roas come from one placement breakdown the Facebook Ads API supports, not from separate exports matched by hand.

source
Facebook Ads · as of Mon 06:40 UTC
covers
1-30 Sep 2026
Example answer · fictional account and figures
Facebook Ads in Gemini

Questions Gemini can answer from your Facebook Ads data

Facebook Ads extracts paid performance from Meta ad accounts, from account down to ad level: spend, delivery, conversions and ROAS, broken down by placement, device, demographics or creative asset.

Audience data for a pandas notebook

Ask Gemini

Query Age Gender Breakdowns Ad Insights for September and save Age, Gender, Spend and Purchase Roas to data/meta-audiences.csv.

A marketing analyst starts Gemini CLI inside the notebook project, approves the query call and loads the file straight into pandas. Next month the same prompt rebuilds the CSV from the scheduled flow, so the charts never depend on whoever exported last.

Verify dashboard math before you merge

Ask Gemini

Our loader in src/metrics/meta.ts divides Purchase (value) by Spend. Pull last week's Facebook Ads Insights per Campaign name and tell me where our ROAS differs.

In Gemini Code Assist agent mode, a developer compares the dashboard's output with figures read from Dataddo before the pull request is merged. Mismatches show up in review, not in the Monday meeting with the paid social team.

A creative inventory as a script

Ask Gemini

Read Ad Name, Creative Title, Body and Creative CTA Type from Ad Creatives (by Ads) and write scripts/creative_audit.py that flags duplicate titles.

A technical marketer gets a small, rerunnable script instead of a one-off answer. It uses the exact field names and runs again after every new batch of ads.

Facebook Ads datasets and the questions they answer in Gemini →
Pricing

Priced per seat.

Data to AI™ is priced per seat, like the AI assistants your team already uses, with ~25% off on annual billing. Need tailored contracts or volume pricing? Talk to us about Enterprise.

Data to AITM

Serve governed business data to Claude, ChatGPT and other AI tools over MCP.

$10.49/month

per seat

3 seats minimum

Enterprise

Flexibly deploy Dataddo in any cloud or hybrid environment.

Custom

We have a payment model that works for you

See all plans and features →
Setup

Connect Facebook Ads to Gemini step by step

  1. 1
    Connect Gemini to Dataddo Add the Dataddo server to settings.json in Gemini CLI, restart it and run /mcp auth dataddo to sign in. Gemini Code Assist in VS Code reads the same file.
  2. 2
    Connect Facebook Ads to Dataddo Sign in with your Facebook Ads account in Dataddo and choose the datasets to sync, such as Facebook Ads Insights and Platform Position Device Ad Insights.
  3. 3
    Choose what Gemini can see Select the Facebook Ads data Gemini may query. Access is read-only, and data you don't select stays out of reach.
Gemini setup guide →
With vs. without

Facebook Ads in Gemini, with and without Dataddo

Without Dataddo With Dataddo Outcome for you
Meta data in a project folder Someone downloads a CSV from Ads Manager, copies it into the repository and renames columns before any script can read it. Gemini CLI asks the dataddo server for Facebook Ads datasets by name, so code starts from fields such as Spend and Purchase Roas. No hand-copied files
Which projects can reach ad data A shared export ends up in every repository, whether the project needs Meta numbers or not. Register the server in .gemini/settings.json of a single project, or in ~/.gemini/settings.json when every project should see it. Access scoped per project
Watching each lookup A script with stored Marketing API credentials runs whatever it was coded to do, and nobody sees the calls. Gemini CLI asks you to confirm every Dataddo tool call, and Always allow is chosen per tool, for example only for query. Every call is visible
Terminal and editor The terminal session and the IDE each work from a different copy of the ad data, exported on different days. Gemini Code Assist agent mode in VS Code reads the same settings.json, so the editor and Gemini CLI query identical Facebook Ads flows. One setup for both tools
Token consumption Gemini spends tokens exploring raw Facebook Ads columns, sampling rows and retrying until it understands the data. Field definitions and relations are supplied up front, so the model skips the exploration and goes straight to the answer. Fewer tokens per answer
Answer quality Prone to wrong joins, invented fields and numbers that are hard to check. Answers grounded in defined fields. In the Dataddo benchmark, 78.5% of questions were answered correctly, against 65.5% with plain CSV files. Better answers
Datasets

Facebook Ads datasets and the questions they answer in Gemini

The Facebook Ads datasets marketing teams use most, with their real field names. Gemini queries them by name through the Dataddo semantic layer.

Dataset Metrics and attributes Ask Gemini
Facebook Ads Insights
  • Ad Set name
  • Spend
  • Impressions
  • CTR
  • Campaign name
  • + others
Write Spend, Impressions and CTR per Ad Set name for the last 14 days to a CSV I can load into a notebook.
Platform Position Device Ad Insights
  • Publisher Platform
  • Platform Position
  • Spend
  • Purchase Roas
  • Impression Device
  • + others
Which Publisher Platform and Platform Position pairs had Spend last week but a Purchase Roas below 1?
Age Gender Breakdowns Ad Insights List the Age and Gender rows with the highest Reach last month as a CSV for our audience notebook.
Video Asset Ad Insights
  • Video Asset
  • Video Thruplay Watched Actions
  • Cost Per Thruplay
  • Video P100 Watched Actions
  • + others
Which Video Asset rows had the most Video Thruplay Watched Actions last month, as a markdown table?
Ad Creatives (by Ads)
  • Ad Name
  • Creative Title
  • Creative CTA Type
  • Body
  • + others
Export Ad Name, Creative Title and Creative CTA Type for every ad to a JSON file for our copy checks.
Campaigns Insights
  • Objective
  • Daily Budget
  • Name
  • Budget Remaining
  • Status
  • + others
Which campaigns have a Daily Budget above the average for campaigns with the same Objective?
See all Facebook Ads datasets, metrics and attributes on the connector page →
Benchmark

More right answers. Half the confident mistakes.

We asked 43 pre-registered questions of three real datasets - Google Search Console, HubSpot deals and Google Ads - and delivered the same rows to the same model in four ways. Only the data layer changed.

78.5%

of questions answered correctly - the best of the four delivery methods tested

2x

fewer confidently wrong answers - 14.0% of runs against 24.0% and 26.3%

2.8x

more correct answers on messy CRM data - better on 8 questions, worse on none

Answered correctly All 43 questions - higher is better
Wrong, but stated as fact Share of runs - lower is better

Same model, prompts and rows in every condition; 759 graded runs, ground truth frozen before any run. On Google Search Console alone, documented CSV files did as well as Data to AI™ - the advantage comes from messier data such as HubSpot deals.

Read the benchmark →
FAQ

Facebook Ads and Gemini: FAQ

How do I connect Facebook Ads to Gemini?

In Dataddo, create a Google Gemini authorizer, a Facebook Ads source with datasets such as Facebook Ads Insights, and a Google Gemini destination or AI Model. Add Dataddo under mcpServers in ~/.gemini/settings.json with httpUrl https://headless.dataddo.com/mcp-data, restart Gemini CLI and run /mcp auth dataddo to sign in.

Why does Gemini CLI fail to connect to the Dataddo server?

Check the key name. The entry must use httpUrl, because url makes Gemini CLI fall back to SSE, which Dataddo does not support. Leave out headers and any oauth block, restart Gemini CLI, then run /mcp auth dataddo.

Does Gemini CLI write anything back to Meta Ads Manager?

No. The Dataddo tools only read Facebook Ads data already extracted into your flows, through the semantic layer. Dataddo never accepts SQL from the model, and budgets, bids and ad statuses in Meta stay exactly as they are.

Can I sign in with my Google account?

No. The sign-in page asks for your Dataddo email and password, with MFA if your account uses it; Google and Microsoft SSO are not offered here. Gemini CLI opens that page in a browser, so run it on a machine that has one.

Will Gemini also see Facebook Ads flows I attached to Claude or ChatGPT?

Yes. Once signed in, Gemini reaches every flow or Context attached to an AI destination or AI Model in that Dataddo account, not only the Google Gemini ones. Attach to AI destinations only the ad accounts you are happy for it to query.

How do I use the connection in IntelliJ?

Gemini Code Assist in IntelliJ uses its own mcp.json instead of settings.json. Add the same Dataddo server there; in VS Code, agent mode picks up the settings.json you already use for Gemini CLI.

My Gemini session stopped returning Facebook Ads data. What now?

Tokens live in ~/.gemini/mcp-oauth-tokens.json and renew automatically. If a session expires or is revoked, run /mcp auth dataddo again, then check /mcp to confirm the dataddo server is connected.

New from Dataddo · Data to AI™

Ask Claude or ChatGPT about your ads, analytics and CRM

“What did a new lead cost us last week, by paid channel?”

Connect 400+ sources once and get the answer right in your AI chat, without building a report. Better answers: your metrics are defined once, so the AI doesn't have to guess.