HomeAI Agents & ChatbotsMonitor AI citations of your website…

Monitor AI citations of your website with n8n

Monitor AI citations of your website with n8n









To monitor AI citations of your website with n8n, you need a workflow that asks a grounded AI real buyer questions and then reads the list of sources it used, checking whether your domain is one of them. This is a step beyond tracking whether an assistant says your name. A citation means the AI actually pulled from your site, trusts it enough to build an answer on, and often links to it, which sends real referral traffic. This guide builds a free workflow that runs weekly, sends your prompts to Gemini with Google Search grounding, records whether your domain and your competitors’ domains are cited, logs every result to Google Sheets, and emails you a citation report. It takes about 40 minutes to build, or a couple of minutes with the template at the end.

What it does

Once a week the workflow sends a set of neutral buyer questions to Google Gemini with search grounding turned on. Grounding makes Gemini search the live web and attach the pages it used as sources, returned in a field called groundingMetadata. The workflow reads that source list for every answer and checks whether your website appears, and which competitor domains appear alongside it.

Each prompt becomes a row in Google Sheets: the question, whether your domain was cited, the exact sources of yours that were used, which competitor domains were cited, and the total number of sources. Because it appends over time, you get a trend of how often AI answers lean on your content. At the end of the run you get one email: “acmeanalytics.com was cited as a source in 2/4 grounded AI answers (50%),” with a table of prompts and a list of the most-cited domains this run.

This is the citation layer of AEO, answer engine optimization. It pairs naturally with the other two checks in the set: the brand-mention tracker (does the AI say your name) and the competitor visibility monitor (how you rank against rivals). New to n8n? Start with how to set up n8n.

Why it beats the default

The default is to have no idea. You publish content, you hope AI answers use it, and you never find out. Checking by hand does not work either: a normal ChatGPT or Gemini answer will not tell you which pages it drew on, because a plain model call answers from memory with no sources at all.

Paid AEO platforms track citations, but they cost a monthly subscription and decide for you which prompts and competitors to watch. This workflow uses grounded search to get the real source list, checks exactly the domains you care about on the exact questions your buyers ask, and writes the history to a sheet you own, for pennies a run. When you publish a new guide, you can watch here whether AI answers start citing it. For more AI workflows you can import, see the best n8n AI agent templates and the full template library.

What you need

  • An n8n instance (Cloud or self-hosted, version 1.0 or newer).
  • A Google Gemini API key with grounding available (free tier includes a daily grounding allowance). Used as an HTTP Header Auth credential with header x-goog-api-key.
  • A Google account for Sheets and a Gmail account for the report.
  • A blank Google Sheet with a header row matching the field names below.
  • Your website domain and a short list of competitor domains.

Time: about 40 minutes from scratch, or under 5 minutes with the template.

Node-by-node list

Seven nodes: a schedule, a config node, one grounded AI call per prompt, a citation reader, and a fork that logs and emails.

Weekly schedule (Mon 7am)
        |
   Prompts & config  (Code: your domain + competitors + prompts)
        |
   Ask Gemini (grounded)  (HTTP: search grounding on)
        |
   Extract citations  (Code: is your domain in the sources?)
        |          |
 Log to Sheets   Build digest
                     |
            Send digest email (Gmail)
  
  1. Weekly schedule (Schedule Trigger) fires every Monday at 7am.
  2. Prompts & config (Code) holds your domain, competitor domains, and prompts.
  3. Ask Gemini (grounded) (HTTP Request) sends each prompt with Google Search grounding enabled.
  4. Extract citations (Code) reads the source list and checks for your domain.
  5. Log to Google Sheets (Google Sheets) appends one row per prompt.
  6. Build digest (Code) rolls the rows into one report with a most-cited-domains list.
  7. Send digest email (Gmail) emails you the report.

Step-by-step build

1. Add the weekly schedule

Add a Schedule Trigger, interval Weeks, every 1 week, day Monday, hour 7. Weekly keeps grounded-search usage tiny while still catching the trend.

2. Set your domain, competitors, and prompts

Add a Code node with your website domain, the competitor domains to watch, and your prompt list. It emits one item per prompt.

const DOMAIN = 'acmeanalytics.com';
const COMPETITOR_DOMAINS = ['datapulse.io', 'insightly.com'];
const PROMPTS = [
  'What are the best analytics tools for a small ecommerce store?',
  'How do I track marketing ROI for a SaaS startup?',
  'What is a good tool for automated weekly sales reports?',
  'How do small teams build a KPI dashboard without engineers?'
];
return PROMPTS.map(p => ({ json: { prompt: p, domain: DOMAIN, competitorDomains: COMPETITOR_DOMAINS } }));
💡

Tip: Use the bare domain (acmeanalytics.com), not the full URL. The check matches that string against every source, so the shorter and more distinctive it is, the cleaner the result.

3. Ask Gemini with grounding

Add an HTTP Request node, method POST. Under Authentication choose Generic Credential Type then Header Auth, with your key stored under the header x-goog-api-key. The body turns grounding on with the google_search tool:

URL:  https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent

JSON body:
={{ JSON.stringify({
  contents: [ { parts: [ { text: $('Prompts & config').item.json.prompt } ] } ],
  tools: [ { google_search: {} } ]
}) }}
📌

Note: The tools: [{ google_search: {} }] block is the whole point. Without it Gemini answers from memory and returns no sources, so there is nothing to check.

4. Extract the citations

Add a Code node. It reads the grounded answer’s source list from groundingMetadata.groundingChunks and checks whether your domain, and each competitor domain, appears.

const cfg = $('Prompts & config').item.json;
const domain = String(cfg.domain).toLowerCase();
const competitors = (cfg.competitorDomains || []).map(d => String(d).toLowerCase());

const cand = ($json?.candidates?.[0]) || {};
const chunks = cand.groundingMetadata?.groundingChunks || [];
const sources = chunks.map(c => ({ uri: c.web?.uri || '', title: c.web?.title || '' }));
const blob = s => (s.uri + ' ' + s.title).toLowerCase();

const yourSources = sources.filter(s => blob(s).includes(domain)).map(s => s.title || s.uri);
const compCited = competitors.filter(cd => sources.some(s => blob(s).includes(cd)));
const citedDomains = Array.from(new Set(sources.map(s => s.title).filter(Boolean)));

return [{ json: {
  report_date: new Date().toISOString().slice(0, 10),
  prompt: cfg.prompt,
  your_domain: cfg.domain,
  your_domain_cited: yourSources.length ? 'yes' : 'no',
  your_cited_sources: yourSources.join(' | '),
  competitor_domains_cited: compCited.join(', '),
  total_sources: sources.length,
  all_cited_domains: citedDomains.slice(0, 10).join(', ')
} }];

A single row looks like this:

{
  "report_date": "2026-08-24",
  "prompt": "What are the best analytics tools for a small ecommerce store?",
  "your_domain": "acmeanalytics.com",
  "your_domain_cited": "yes",
  "your_cited_sources": "acmeanalytics.com",
  "competitor_domains_cited": "datapulse.io",
  "total_sources": 6,
  "all_cited_domains": "acmeanalytics.com, g2.com, datapulse.io, reddit.com"
}
💡

Tip: Grounding returns a redirect URL plus a title that is usually the source domain, so the check looks at both fields. If a source shows only a page title, widen your domain string or add your brand name to the match.

5. Log to Sheets and email the report

Add a Google Sheets node (operation Append Row, mapping Map Automatically) with a header row of report_date, prompt, your_domain, your_domain_cited, your_cited_sources, competitor_domains_cited, total_sources, all_cited_domains. Then add a Code node to build the digest and a Gmail node (Email Type HTML) mapping subject and message from it. Save and activate.

Common mistakes

  • Forgetting the grounding tool. Without tools: [{ google_search: {} }] there are no sources to read, and every prompt returns “not cited”.
  • Passing a full URL as your domain. Use the bare domain so it matches both the source URL and the title field.
  • Naming a brand in the prompt. As with the rest of the AEO set, prompts must be neutral buyer questions or the result is rigged.
  • Expecting citations from a non-grounded model. Plain generateContent answers from memory. Only grounded search returns a source list.
  • Mismatched Sheet headers. Automatic mapping needs exact column names, or columns land blank.

Cost at realistic volume

One grounded call per prompt, one Sheets append per prompt, one email per run.

Service Usage per weekly run (8 prompts) Cost
Gemini grounded search 8 grounded calls Free daily allowance, then ~$35 / 1,000 prompts
Google Sheets 8 row appends Free
Gmail 1 email Free
n8n 1 execution / week Free self-hosted; ~4 executions/month on Cloud

At eight prompts a week you are around thirty grounded calls a month, comfortably inside the free allowance for most accounts, or a few cents if you exceed it. The paid tools that track AI citations start around fifty dollars a month.

Get the AI citation monitor template

The guide above is free to follow. If you would rather skip the build, the ready-to-import template drops all seven nodes and every script onto your canvas. Import it, add your Gemini, Google Sheets, and Gmail credentials, set your domain and prompts, and your first citation report can run today. Want it installed and tuned to your market? Our done-for-you service sets it up end to end.

Download the template ($19) →

Instant download · Works on n8n Cloud and self-hosted

Frequently asked questions

What is an AI citation and why does it matter?

When a grounded AI answer pulls from the live web, it lists the sources it drew on. Being one of those sources means the AI is reading and trusting your content, which drives referral traffic and shapes how it describes your space. Getting cited is the AEO equivalent of ranking on page one.

How is this different from tracking brand mentions?

A brand mention is the AI saying your name. A citation is the AI linking to your website as a source it used. You can be mentioned without being cited, and cited without being named. This workflow tracks the citation, which is the one that sends traffic and signals authority.

Why use Gemini with Google Search grounding?

Plain model calls answer from memory and return no sources. Grounding tells Gemini to search the live web and attach the pages it used in groundingMetadata. That source list is exactly what this workflow reads, so grounding is what makes citation tracking possible at all.

Does grounded search cost more than a normal AI call?

Yes, a little. Grounding with Google Search has a free daily allowance, then bills around thirty-five dollars per thousand grounded prompts. A weekly run of six to ten prompts stays inside the free tier or costs pennies a month, far less than a paid AEO tool.

Can I track citations in ChatGPT or Perplexity too?

Yes. Add an HTTP node for OpenAI’s web-search model or Perplexity, both of which return source URLs, and feed their sources into the same Extract citations logic. The Sheets log and digest do not change, so you can widen coverage without rebuilding.

Related guides