{
  "name": "Shopify AI Visibility Monitor (AEO)",
  "nodes": [
    {
      "parameters": {
        "content": "## Shopify AI Visibility Monitor (AEO)\n\nOnce a week this workflow asks an AI the buying questions your customers ask, checks whether your store gets recommended in the answer, and logs the result to Google Sheets. Track your visibility in AI shopping answers over time, for free.\n\n### Setup (about 5 minutes)\n1. Open **Your store and prompts** and set your store name, your domain, and the shopping questions you want to track.\n2. On **Google Gemini Chat Model**, add your free **Google Gemini** API key from Google AI Studio.\n3. Make a Google Sheet with the headers: Date, Prompt, Store mentioned, AI answer. On **Log to sheet**, add your Google Sheets credential and pick that sheet and tab.\n4. Save, then turn the workflow **Active**.\n\nRuns on Gemini's free tier, so there is no per-check cost. Full guide: easyworkflows.net/shopify-ai-visibility-monitor-n8n/",
        "height": 420,
        "width": 460,
        "color": 4
      },
      "id": "a1111111-1111-4111-8111-111111111111",
      "name": "Read me first",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-560, -120]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * 1"
            }
          ]
        }
      },
      "id": "a2222222-2222-4222-8222-222222222222",
      "name": "Weekly check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [40, 120]
    },
    {
      "parameters": {
        "jsCode": "// EDIT THIS NODE: your store name, your domain, and the shopping questions to track.\nconst storeName = \"Your Store Name\";\nconst storeDomain = \"yourstore.com\";\n\nconst prompts = [\n  \"best organic cotton t-shirts to buy online\",\n  \"top rated eco friendly water bottles\",\n  \"where to buy handmade leather wallets\",\n  \"best budget wireless earbuds in 2026\",\n  \"recommended natural skincare brands for sensitive skin\"\n];\n\nreturn prompts.map(p => ({ json: { prompt: p, storeName, storeDomain } }));"
      },
      "id": "a3333333-3333-4333-8333-333333333333",
      "name": "Your store and prompts",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [280, 120]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.prompt }}",
        "options": {
          "systemMessage": "=You are a helpful shopping assistant. A shopper asks you a buying question. Answer the way you normally would, recommending specific brands, stores, and products a shopper could actually buy. Give a natural, concrete answer in a few sentences. Do not say that you are being tested or monitored, and do not add disclaimers."
        }
      },
      "id": "a4444444-4444-4444-8444-444444444444",
      "name": "Ask the AI as a shopper",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [540, 120]
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.5-flash",
        "options": {}
      },
      "id": "a5555555-5555-4555-8555-555555555555",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [540, 340]
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const answer = ($json.output || \"\").toString();\nconst src = $('Your store and prompts').item.json;\nconst name = (src.storeName || \"\").toLowerCase().trim();\nconst domain = (src.storeDomain || \"\").toLowerCase().trim();\nconst hay = answer.toLowerCase();\nconst mentioned = (!!name && hay.includes(name)) || (!!domain && hay.includes(domain));\nreturn {\n  date: new Date().toISOString().slice(0, 10),\n  prompt: src.prompt,\n  mentioned: mentioned ? \"Yes\" : \"No\",\n  answer: answer.slice(0, 1000)\n};"
      },
      "id": "a6666666-6666-4666-8666-666666666666",
      "name": "Is your store mentioned?",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [800, 120]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": { "__rl": true, "value": "", "mode": "list" },
        "sheetName": { "__rl": true, "value": "", "mode": "list" },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Date": "={{ $json.date }}",
            "Prompt": "={{ $json.prompt }}",
            "Store mentioned": "={{ $json.mentioned }}",
            "AI answer": "={{ $json.answer }}"
          },
          "matchingColumns": [],
          "schema": [
            { "id": "Date", "displayName": "Date", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true },
            { "id": "Prompt", "displayName": "Prompt", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true },
            { "id": "Store mentioned", "displayName": "Store mentioned", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true },
            { "id": "AI answer", "displayName": "AI answer", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": true
        },
        "options": {}
      },
      "id": "a7777777-7777-4777-8777-777777777777",
      "name": "Log to sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [1060, 120]
    }
  ],
  "connections": {
    "Weekly check": { "main": [[{ "node": "Your store and prompts", "type": "main", "index": 0 }]] },
    "Your store and prompts": { "main": [[{ "node": "Ask the AI as a shopper", "type": "main", "index": 0 }]] },
    "Google Gemini Chat Model": { "ai_languageModel": [[{ "node": "Ask the AI as a shopper", "type": "ai_languageModel", "index": 0 }]] },
    "Ask the AI as a shopper": { "main": [[{ "node": "Is your store mentioned?", "type": "main", "index": 0 }]] },
    "Is your store mentioned?": { "main": [[{ "node": "Log to sheet", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" },
  "active": false,
  "pinData": {},
  "meta": { "templateCredsSetupCompleted": false }
}
