基于 GPT-4 专家的全面 SEO 审计,使用 Analytics、Search Console 和 PageSpeed
高级
这是一个Market Research, AI Summarization领域的自动化工作流,包含 38 个节点。主要使用 Set, Code, Merge, HttpRequest, GoogleSheets 等节点。 基于 GPT-4 专家的全面 SEO 审计,使用 Analytics、Search Console 和 PageSpeed
前置要求
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
- •OpenAI API Key
使用的节点 (38)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "8599d7845a778242eb2b590f9276e0b22e25a242e7728a8fa6887cb7c35c668a",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "934d8441-bf80-4dec-9423-8adc877d55d7",
"name": "计划触发器",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-4680,
-580
],
"parameters": {
"rule": {
"interval": [
{
"field": "months",
"triggerAtHour": 9
}
]
}
},
"typeVersion": 1.2
},
{
"id": "122563ce-0d90-4adc-bcc0-8e806c19e114",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-2860,
-1120
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-nano",
"cachedResultName": "gpt-4.1-nano"
},
"options": {
"temperature": 0.3
}
},
"credentials": {
"openAiApi": {
"id": "QrtszTAQelTLppHh",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "2f9345a9-c5f1-4564-8ef3-836d75281fe1",
"name": "追加行",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-2620,
-1120
],
"parameters": {
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1OiqXcLWhxBewkm88MN2etNutPA2IgiyRwMmyNeLAyz4",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OiqXcLWhxBewkm88MN2etNutPA2IgiyRwMmyNeLAyz4/edit?usp=drivesdk",
"cachedResultName": "Rapport GA"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "lmJOtRvKMOD3WkGJ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "57e0c737-c007-4a9e-9258-df083a3bfd50",
"name": "OpenAI 聊天模型1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-2860,
-320
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-nano",
"cachedResultName": "gpt-4.1-nano"
},
"options": {
"temperature": 0.3
}
},
"credentials": {
"openAiApi": {
"id": "QrtszTAQelTLppHh",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "50dd07fa-a710-4d03-8a81-95098a6454e5",
"name": "OpenAI 聊天模型2",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-2860,
-720
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-nano",
"cachedResultName": "gpt-4.1-nano"
},
"options": {
"temperature": 0.3
}
},
"credentials": {
"openAiApi": {
"id": "QrtszTAQelTLppHh",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "fdb3b364-b3a0-4a45-8f71-c27fd8a91c8b",
"name": "OpenAI聊天模型3",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-2860,
180
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-nano",
"cachedResultName": "gpt-4.1-nano"
},
"options": {
"temperature": 0.3
}
},
"credentials": {
"openAiApi": {
"id": "QrtszTAQelTLppHh",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "8deb28d8-858d-42df-8802-3c339c83494f",
"name": "OpenAI 聊天模型4",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-1780,
-420
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-nano",
"cachedResultName": "gpt-4.1-nano"
},
"options": {
"temperature": 0.3
}
},
"credentials": {
"openAiApi": {
"id": "QrtszTAQelTLppHh",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "4ef711bd-bcaa-4b61-8dfd-f4cc36f8a0a1",
"name": "获取行4",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-1600,
-420
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "lmJOtRvKMOD3WkGJ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "a0760c4c-5455-42e5-88c2-fcaa0f3141b0",
"name": "合并",
"type": "n8n-nodes-base.merge",
"position": [
-2200,
-660
],
"parameters": {
"numberInputs": 4
},
"typeVersion": 3.2
},
{
"id": "8376066b-cb77-4b60-93d1-c883eaafbb39",
"name": "Search Console",
"type": "n8n-nodes-base.httpRequest",
"position": [
-3300,
-440
],
"parameters": {
"url": "=https://www.googleapis.com/webmasters/v3/sites/{{ encodeURIComponent($('Set Target Website').item.json.domain) }}/searchAnalytics/query",
"method": "POST",
"options": {},
"jsonBody": "{\n \"startDate\": \"{{ $now.minus({months: 1}).toFormat('yyyy-MM-dd') }}\",\n \"endDate\": \"{{ $now.toFormat('yyyy-MM-dd') }}\",\n \"dimensions\": [\"query\"],\n \"rowLimit\": 10\n}\n",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"nodeCredentialType": "googleOAuth2Api"
},
"credentials": {
"googleOAuth2Api": {
"id": "EanrW0MuDv56q9BH",
"name": "search console"
}
},
"typeVersion": 4.2
},
{
"id": "d3676416-da4b-41ea-8b9b-b18ea5adbef8",
"name": "设置目标网站",
"type": "n8n-nodes-base.set",
"position": [
-4380,
-580
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e3962683-6d91-4db2-af47-8ade2b8fb444",
"name": "domain",
"type": "string",
"value": "https://www.your-website.com"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ef6218b1-dff2-41fc-9aad-6d7e7a3c809a",
"name": "格式化 GA 数据",
"type": "n8n-nodes-base.code",
"position": [
-3080,
-1240
],
"parameters": {
"jsCode": "// n8n code to aggregate all Google Analytics data into a single block for the LangChain agent\n\n// Get all input data from the Google Analytics node\nconst inputData = $input.all();\n\n// Function to format numbers with thousand separators\nfunction formatNumber(num) {\n return parseInt(num).toLocaleString('en-US');\n}\n\n// Function to extract the domain from a URL\nfunction extractDomain(url) {\n if (!url) return 'unknown';\n try {\n const cleanUrl = url.replace(/^https?:\\/\\//, '').replace(/^www\\./, '');\n const domain = cleanUrl.split('/')[0];\n return domain;\n } catch (error) {\n return 'unknown';\n }\n}\n\n// Aggregate all data\nconst allData = inputData.map(item => item.json);\n\n// Calculate totals and global metrics\nconst aggregatedMetrics = {\n totalSessions: allData.reduce((sum, item) => sum + parseInt(item.sessions || 0), 0),\n totalUsers: allData.reduce((sum, item) => sum + parseInt(item.totalUsers || 0), 0),\n totalPageViews: allData.reduce((sum, item) => sum + parseInt(item.screenPageViews || 0), 0),\n countries: [...new Set(allData.map(item => item.country).filter(Boolean))],\n urls: [...new Set(allData.map(item => item.pageLocation).filter(Boolean))],\n dataCount: allData.length\n};\n\n// Calculate derived metrics\naggregatedMetrics.avgPageViewsPerSession = (aggregatedMetrics.totalPageViews / aggregatedMetrics.totalSessions).toFixed(2);\naggregatedMetrics.avgSessionsPerUser = (aggregatedMetrics.totalSessions / aggregatedMetrics.totalUsers).toFixed(2);\naggregatedMetrics.returnUserRate = ((aggregatedMetrics.totalSessions - aggregatedMetrics.totalUsers) / aggregatedMetrics.totalSessions * 100).toFixed(1);\n\n// Create the comprehensive text summary\nconst comprehensiveReport = `\n=== GOOGLE ANALYTICS REPORT - LAST 30 DAYS ===\n\n📊 GLOBAL METRICS:\n• Total sessions: ${formatNumber(aggregatedMetrics.totalSessions)}\n• Unique users: ${formatNumber(aggregatedMetrics.totalUsers)}\n• Total page views: ${formatNumber(aggregatedMetrics.totalPageViews)}\n• Page views per session: ${aggregatedMetrics.avgPageViewsPerSession}\n• Sessions per user: ${aggregatedMetrics.avgSessionsPerUser}\n• Returning user rate: ${aggregatedMetrics.returnUserRate}%\n\n🌍 GEOGRAPHICAL BREAKDOWN:\n• Number of countries: ${aggregatedMetrics.countries.length}\n• Main countries: ${aggregatedMetrics.countries.join(', ')}\n\n🔗 WEBSITES ANALYZED:\n• Number of URLs: ${aggregatedMetrics.urls.length}\n• Main URLs: ${aggregatedMetrics.urls.join(', ')}\n`.trim();\n\n// Simplified return with a single \"content\" field\nreturn [{\n json: {\n content: comprehensiveReport\n }\n}];\n"
},
"typeVersion": 2
},
{
"id": "ed1a7666-4808-44cf-a415-7ccc76f22d2a",
"name": "分析专家代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-2828,
-1340
],
"parameters": {
"text": "=Aujourd'hui nous sommes le {{ $now }}\n\nTu es un expert Google Analytics spécialisé dans l'analyse de sites web tech/IA. \n\nMISSION : Analyser les données GA4 pour nana-intelligence.fr et identifier les opportunités d'optimisation.\n\nDONNÉES D'ENTRÉE : {{ $json.content }}\n\nANALYSE REQUISE :\n📊 Métriques de performance globale\n- Sessions, utilisateurs, taux de rebond\n- Durée moyenne des sessions\n- Pages vues par session\n- Sources de trafic principales\n\n🎯 Analyse comportementale\n- Pages les plus performantes\n- Parcours utilisateur type\n- Points de friction identifiés\n- Taux de conversion par source\n\n📈 Tendances et évolution\n- Comparaison avec période précédente\n- Saisonnalité du trafic\n- Impact des publications de contenu\n- Croissance du trafic organique\n\nFOCUS SPÉCIAL NICHE IA :\n- Performance du contenu IA/tech\n- Engagement sur les articles techniques\n- Conversion des visiteurs intéressés par l'IA\n\nFORMAT DE SORTIE :\nRetourne un objet JSON structuré avec :\n{\n 'performance_globale': {...},\n 'comportement_utilisateurs': {...},\n 'tendances': {...},\n 'recommandations_analytics': [...]\n\n",
"options": {
"systemMessage": "={\n \"systemMessage\": \"Tu es un analyste web senior avec 10 ans d'expérience dans l'analyse de sites tech/IA. Ton ton est professionnel mais accessible. Tu détectes les patterns cachés dans les données et proposes des actions concrètes. Tu maîtrises parfaitement les spécificités du secteur de l'intelligence artificielle et du marketing digital.IMPORTANT: Termine TOUJOURS ta réponse par un JSON structuré avec les KPIs demandés, puis un paragraphe de synthèse executive claire pour le chef d'entreprise.\n\"\n}\n"
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "95e9373d-cbfd-42ae-aba4-fc3e351f0a0f",
"name": "格式化 Search Console 数据",
"type": "n8n-nodes-base.code",
"position": [
-3080,
-440
],
"parameters": {
"jsCode": "// Formatting for Search Console with handling of empty data\nconst data = $input.first().json;\n\n// Check if we have actual data\nconst hasData = data.rows && data.rows.length > 0;\n\nif (!hasData) {\n // Case for a new/recent site - Constructive response\n const reportText = `\n=== GOOGLE SEARCH CONSOLE REPORT - TARGET WEBSITE ===\n📊 ANALYSIS DATE: ${new Date().toLocaleDateString('en-US')}\n\n🆕 STATUS: SITE IN SEO START-UP PHASE\n• No Search Console data available (this is normal for a new site).\n• API functional: ✅ Authentication successful.\n\n🚀 POSITIVE DIAGNOSIS:\n• Technical setup: Correct.\n• Google API access: Validated.\n• Indexing: In progress.\n\n🎯 RECOMMENDATIONS TO SPEED UP INDEXING:\n• Submit the XML sitemap to Google Search Console.\n• Create high-quality content regularly.\n• Obtain natural backlinks.\n• Optimize meta descriptions and titles.\n• Use Google Search Console to request manual indexing.\n\n⏳ EXPECTED TIMELINE:\n• First GSC data: 2-4 weeks after indexing.\n• Significant data: 2-3 months with regular content.\n• Mature SEO performance: 6-12 months.\n`;\n\n return [{\n json: {\n content: reportText,\n searchConsoleData: {\n status: \"new_site\",\n hasData: false,\n }\n }\n }];\n}\n\n// If we have data\nconst searchData = data.rows.map(row => ({\n query: row.keys[0] || 'Not specified',\n clicks: row.clicks || 0,\n impressions: row.impressions || 0,\n ctr: ((row.ctr || 0) * 100).toFixed(2),\n position: (row.position || 0).toFixed(1)\n}));\n\nconst totalClicks = searchData.reduce((sum, item) => sum + item.clicks, 0);\nconst totalImpressions = searchData.reduce((sum, item) => sum + item.impressions, 0);\n\nconst reportText = `\n=== GOOGLE SEARCH CONSOLE REPORT - DATA AVAILABLE ===\n📊 METRICS: ${totalClicks} clicks, ${totalImpressions} impressions.\n🔝 TOP QUERIES: ${searchData.slice(0, 5).map(item => item.query).join(', ')}\n`;\n\nreturn [{\n json: {\n content: reportText,\n searchConsoleData: {\n status: \"data_available\",\n hasData: true,\n totalClicks,\n totalImpressions,\n topQueries: searchData.slice(0, 5)\n }\n }\n}];\n"
},
"typeVersion": 2
},
{
"id": "d7d2dda7-896b-462c-b959-e782dac35e52",
"name": "SEO 专家代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-2828,
-540
],
"parameters": {
"text": "=Tu es un consultant SEO senior spécialisé dans le lancement de sites tech/IA.\n\nMISSION : Analyser la situation Search Console et proposer une stratégie d'accélération SEO.\n\nDONNÉES REÇUES : {{ $json.content }}\nSTATUT TECHNIQUE : {{ $json.searchConsoleData }}\n\nCONTEXTE SPÉCIFIQUE :\n- Site spécialisé en intelligence artificielle \n- Phase de démarrage SEO (normal d'avoir peu/pas de données)\n- Besoin de stratégie d'accélération de la visibilité\n\nANALYSE REQUISE :\n\n🚀 Diagnostic Phase de Démarrage\n- Évaluation de la situation actuelle\n- Identification des leviers prioritaires\n- Timeline réaliste d'acquisition de trafic\n\n🎯 Stratégie Contenu IA/Tech \n- Mots-clés prioritaires secteur IA\n- Sujets de contenu à forte valeur ajoutée\n- Optimisation technique pour Google\n\n📈 Plan d'Accélération SEO\n- Actions week 1-4 (indexation rapide)\n- Actions mois 2-3 (construction autorité) \n- Actions mois 3-6 (scaling traffic organique)\n\n💰 ROI et Objectifs Chiffrés\n- Objectifs de trafic réalistes par trimestre\n- KPIs à tracker prioritairement\n- Budget/ressources recommandées\n\nFORMAT RÉPONSE :\n- Synthèse situationnelle (2-3 phrases)\n- Top 3 actions immédiates (cette semaine)\n- Stratégie contenu IA 30-60-90 jours\n- Objectifs chiffrés à 6 mois\n\nSois encourageant, précis et axé ROI. Utilise des émojis pour structurer.\n",
"options": {
"systemMessage": "You must respond only in English. Be precise, actionable, and results-oriented. Use quantified data whenever possible.\n"
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "40f48efd-4c90-4e05-82c8-8eee42838955",
"name": "获取 PageSpeed 数据",
"type": "n8n-nodes-base.httpRequest",
"position": [
-3300,
-840
],
"parameters": {
"url": "=https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url={{ $json.domain }}&category=performance&category=accessibility&category=best-practices&category=seo",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth"
},
"credentials": {
"httpQueryAuth": {
"id": "RF8SXqKZv6zCD2Q4",
"name": "pagespeed_insight"
}
},
"typeVersion": 4.2
},
{
"id": "186246bb-53c6-4f42-94db-657253bcff70",
"name": "格式化 PageSpeed 数据",
"type": "n8n-nodes-base.code",
"position": [
-3080,
-840
],
"parameters": {
"jsCode": "// Advanced formatting of Page Speed Insights data\nconst data = $input.first().json;\n\n// Verify that the data is valid\nif (!data.lighthouseResult) {\n return [{\n json: {\n error: \"Invalid Page Speed Insights data\",\n content: \"Error while fetching performance metrics\"\n }\n }];\n}\n\nconst lighthouse = data.lighthouseResult;\n\n// Generate the text report for the AI agent\nconst reportText = `\n=== PAGE SPEED INSIGHTS REPORT - TARGET WEBSITE ===\n📊 ANALYSIS DATE: ${new Date().toLocaleDateString('en-US')} - Strategy: ${lighthouse.configSettings.emulatedFormFactor}\n\n🎯 LIGHTHOUSE SCORES:\n• Performance: ${Math.round(lighthouse.categories.performance.score * 100)}/100\n• Accessibility: ${Math.round(lighthouse.categories.accessibility.score * 100)}/100\n• Best Practices: ${Math.round(lighthouse.categories['best-practices'].score * 100)}/100\n• SEO: ${Math.round(lighthouse.categories.seo.score * 100)}/100\n\n⚡ CORE WEB VITALS:\n• First Contentful Paint: ${lighthouse.audits['first-contentful-paint'].displayValue}\n• Largest Contentful Paint: ${lighthouse.audits['largest-contentful-paint'].displayValue}\n• Cumulative Layout Shift: ${lighthouse.audits['cumulative-layout-shift'].displayValue}\n• Speed Index: ${lighthouse.audits['speed-index'].displayValue}\n`;\n\nreturn [{\n json: {\n content: reportText\n }\n}];\n"
},
"typeVersion": 2
},
{
"id": "589300cb-913e-4dfe-b987-cb9077c3049a",
"name": "性能专家代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-2820,
-940
],
"parameters": {
"text": "=Aujourd'hui nous sommes le {{ $now }}\n\nTu es un expert en performance web et Core Web Vitals, spécialisé dans l'optimisation de sites tech/IA.\n\nMISSION : Analyser les métriques PageSpeed Insights de nana-intelligence.fr et proposer des optimisations concrètes.\n\nDONNÉES REÇUES : {{ $json.content }}\nMÉTRIQUES STRUCTURÉES : {{ $json.pagespeed_data }}\n\nANALYSE REQUISE :\n\n⚡ Core Web Vitals\n- Évaluation LCP, FID, CLS vs seuils Google\n- Impact sur l'expérience utilisateur\n- Priorisation des corrections\n\n📱 Performance Mobile vs Desktop\n- Identification des goulots d'étranglement\n- Optimisations spécifiques par device\n\n🔧 Optimisations Techniques Prioritaires\n- Resources bloquantes critiques\n- Optimisation images et médias\n- Minification CSS/JS\n- Stratégies de cache\n\n🎯 Impact SEO & Business\n- Corrélation performance/classements Google\n- ROI estimé des optimisations\n- Objectifs chiffrés à 30 jours\n\nCONTEXTE : Site IA/tech avec contenu riche nécessitant performance optimale.\n\nFORMAT RÉPONSE :\n- Synthèse performance actuelle (2-3 phrases)\n- Top 3 optimisations prioritaires avec impact estimé\n- Plan d'action technique avec timeline\n- Objectifs de performance à atteindre\n\nUtilise des émojis pour structurer ta réponse et sois concret dans tes recommandations.",
"options": {
"systemMessage": "You must respond only in English. Be precise, actionable, and results-oriented. Use quantified data whenever possible.\n"
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "bb516f2c-aa34-48dc-9201-19fcace4e1f6",
"name": "爬取网站首页",
"type": "n8n-nodes-base.httpRequest",
"position": [
-3520,
-40
],
"parameters": {
"url": "={{ $json.domain }}",
"options": {},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (compatible; n8n-seo-audit/1.0)"
},
{
"name": "Accept",
"value": "text/html,application/xhtml+xml"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "3d69a9e4-a206-491f-80d0-6b28da693fab",
"name": "提取页面 SEO 数据",
"type": "n8n-nodes-base.code",
"position": [
-3300,
-40
],
"parameters": {
"jsCode": "// Complete extraction of SEO data from HTML\nconst html = $input.first().json.body || $input.first().json.data || '';\n\nif (!html) {\n return [{\n json: {\n error: \"No HTML content retrieved\",\n content: \"Error while scraping the site\"\n }\n }];\n}\n\nfunction cleanText(text) {\n return text ? text.replace(/<[^>]*>/g, '').trim() : '';\n}\n\nconst seoExtraction = {\n title: cleanText(html.match(/<title[^>]*>(.*?)<\\/title>/i)?.[1]) || 'Not found',\n metaDescription: html.match(/<meta[^>]*name=[\"']description[\"'][^>]*content=[\"']([^\"']*)[\"'][^>]*>/i)?.[1] || 'Not found',\n h1Tags: (html.match(/<h1[^>]*>(.*?)<\\/h1>/gi) || []).map(h1 => cleanText(h1)),\n totalImages: (html.match(/<img[^>]*>/gi) || []).length,\n imagesWithAlt: (html.match(/<img[^>]*alt=[\"'][^\"']*[\"'][^>]*>/gi) || []).length,\n};\n\nseoExtraction.imagesWithoutAlt = seoExtraction.totalImages - seoExtraction.imagesWithAlt;\n\nreturn [{\n json: seoExtraction\n}];\n"
},
"typeVersion": 2
},
{
"id": "c8b99b81-c718-4477-b59d-7bbbb0779ac5",
"name": "评分页面 SEO",
"type": "n8n-nodes-base.code",
"position": [
-3080,
-40
],
"parameters": {
"jsCode": "// Complete analysis and scoring of extracted SEO data\nconst seoData = $input.first().json;\n\nif (!seoData || !seoData.title) {\n return [{\n json: {\n error: \"Missing SEO data\",\n content: \"Unable to proceed with the audit\"\n }\n }];\n}\n\n// SEO scoring system (out of 100 points)\nconst scoring = {\n technical: 0,\n onPage: 0,\n};\n\n// TECHNICAL SCORE\nif (seoData.title && seoData.title !== 'Not found') scoring.technical += 10;\nif (seoData.metaDescription && seoData.metaDescription !== 'Not found') scoring.technical += 10;\n\n// ON-PAGE SCORE\nif (seoData.h1Tags.length === 1) scoring.onPage += 10;\nif (seoData.imagesWithoutAlt === 0 && seoData.totalImages > 0) scoring.onPage += 10;\n\nconst totalScore = scoring.technical + scoring.onPage;\nlet scoreStatus = '';\nif (totalScore >= 80) scoreStatus = 'EXCELLENT';\nelse if (totalScore >= 60) scoreStatus = 'GOOD';\nelse if (totalScore >= 40) scoreStatus = 'AVERAGE';\nelse scoreStatus = 'POOR';\n\nconst criticalIssues = [];\nif (!seoData.title || seoData.title === 'Not found') criticalIssues.push('❌ CRITICAL: Missing title');\nif (!seoData.metaDescription || seoData.metaDescription === 'Not found') criticalIssues.push('❌ CRITICAL: Missing meta description');\nif (seoData.h1Tags.length === 0) criticalIssues.push('❌ CRITICAL: No H1 tag detected');\nelse if (seoData.h1Tags.length > 1) criticalIssues.push('⚠️ IMPORTANT: Multiple H1 tags detected');\n\nconst recommendations = [];\nif (seoData.imagesWithoutAlt > 0) recommendations.push(`🖼️ Add alt text to ${seoData.imagesWithoutAlt} images`);\n\n// Complete audit report\nconst auditReport = `\n=== COMPLETE TECHNICAL SEO AUDIT - TARGET WEBSITE ===\n📊 ANALYSIS DATE: ${new Date().toLocaleDateString('en-US')}\n\n★ GLOBAL SEO SCORE: ${totalScore}/100 (${scoreStatus})\n\n📋 ON-PAGE ANALYSIS:\n• Title: ${seoData.title !== 'Not found' ? '✅ ' + seoData.title.substring(0, 80) : '❌ Missing'}\n• Meta description: ${seoData.metaDescription !== 'Not found' ? '✅ ' + seoData.metaDescription.substring(0, 100) : '❌ Missing'}\n• H1: ${seoData.h1Tags.length} found(s) ${seoData.h1Tags.length === 1 ? '✅' : '⚠️'}\n• Images with alt text: ${seoData.imagesWithAlt}/${seoData.totalImages} ${seoData.imagesWithoutAlt === 0 ? '✅' : '❌'}\n\n${criticalIssues.length > 0 ? '🚨 CRITICAL ISSUES:\\n' + criticalIssues.join('\\n') : ''}\n${recommendations.length > 0 ? '💡 PRIORITY RECOMMENDATIONS:\\n' + recommendations.map(rec => '• ' + rec).join('\\n') : ''}\n`;\n\nreturn [{\n json: {\n content: auditReport,\n auditData: {\n totalScore,\n scoreStatus,\n scoring,\n criticalIssues,\n recommendations,\n }\n }\n}];\n"
},
"typeVersion": 2
},
{
"id": "4901342b-1f93-4083-9cc1-1ae4d28d011d",
"name": "技术审计代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-2820,
-40
],
"parameters": {
"text": "=You are a senior technical SEO expert, specializing in auditing and optimizing AI/tech websites.\n\nMISSION: Analyze the complete technical audit and create a prioritized action plan.\n\nAUDIT DATA: {{ $json.content }}\nDETAILED METRICS: {{ $json.auditData }}\n\n### In-Depth Analysis Required:\n\n🔍 **Expert Diagnosis**\n- Evaluate the overall score and position against competitors.\n- Identify quick wins versus long-term optimizations.\n- Prioritize based on SEO impact vs. required effort.\n\n⚡ **Immediate Action Plan (7 days)**\n- Critical fixes to implement first.\n- Quick on-page optimizations.\n- Essential technical improvements.\n\n📈 **Technical Roadmap (30-90 days)**\n- Phase 1 (0-30d): Solid SEO foundations.\n- Phase 2 (30-60d): Advanced optimizations.\n- Phase 3 (60-90d): Performance and monitoring.\n\n💰 **ROI and Estimated Impact**\n- Potential traffic gain per improvement.\n- Required resources vs. benefits.\n- Realistic timeline to see results.\n\n### TOOL USAGE INSTRUCTIONS (VERY IMPORTANT)\nOnce your analysis is complete, before formulating your final response, you MUST use the `Append or update row in sheet in Google Sheets` tool to save a summary.\nTo do this, you must provide data in a perfect JSON format matching the spreadsheet columns:\n\n{\n \"Date\": \"{{ $now.toISODate() }}\", // Use current date in YYYY-MM-DD format\n \"Source\": \"Technical SEO Audit\",\n \"Rapport\": \"Insert a concise summary of your audit here (2-3 paragraphs max).\",\n \"Recommandations\": \"List the top 3 most critical recommendations here as a bulleted list.\"\n}\n\nAfter successfully calling this tool, you can then formulate your full response for the end-user.\n\n### RESPONSE FORMAT:\nStructure your final response with emojis, clear sections, and highly concrete recommendations. Conclude with a dashboard of 5 main KPIs to track.\n",
"options": {
"systemMessage": "You must respond only in English. Be precise, actionable, and results-oriented. Use quantified data whenever possible.\n"
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "8b01b20c-c10c-43a9-8fe7-34d3d703933c",
"name": "汇总所有报告",
"type": "n8n-nodes-base.code",
"position": [
-1980,
-640
],
"parameters": {
"jsCode": "// Simple aggregator - post-merge\nconst allInputs = $input.all();\n\n// Extract contents\nconst reports = allInputs.map((input, index) => ({\n index: index + 1,\n content: input.json.output || input.json.content || JSON.stringify(input.json),\n}));\n\n// Create the consolidated text\nconst consolidatedText = `\n=== CONSOLIDATED DATA FOR MASTER ANALYST ===\n📊 Reports received: ${reports.length}/4\n\n📄 REPORT 1 (ANALYTICS):\n${reports[0]?.content.substring(0, 1000)}...\n\n📄 REPORT 2 (PAGESPEED):\n${reports[1]?.content.substring(0, 1000)}...\n\n📄 REPORT 3 (SEARCH CONSOLE):\n${reports[2]?.content.substring(0, 1000)}...\n\n📄 REPORT 4 (TECHNICAL AUDIT):\n${reports[3]?.content.substring(0, 1000)}...\n\n🎯 MASTER ANALYST INSTRUCTIONS:\nAnalyze these 4 reports and create a comprehensive SEO summary with a prioritized action plan.\n`;\n\nreturn [{\n json: {\n textSummary: consolidatedText\n }\n}];\n"
},
"typeVersion": 2
},
{
"id": "4d826fd3-118b-4316-bb10-0ac18bf8d694",
"name": "主分析师代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1760,
-640
],
"parameters": {
"text": "=You are the MASTER SEO ANALYST, an expert in strategic synthesis and actionable recommendations.\n\nCONSOLIDATED DATA RECEIVED: {{ $json.textSummary }}\nMETADATA: {{ $json.reportMetadata }}\n\nMISSION: Create a 360° SEO analysis and a prioritized action plan for nana-intelligence.fr.\n\nSPECIFIC CONTEXT:\n- Site specializing in artificial intelligence\n- Growth and SEO optimization phase\n- Need for concrete and prioritized recommendations\n\nCOMPLETE ANALYSIS REQUIRED:\n\n🎯 EXECUTIVE SUMMARY\n- Estimated overall SEO score (/100)\n- 3 main strengths identified\n- 3 critical weaknesses to correct\n- Estimated competitive positioning\n\n📊 CROSS-FUNCTIONAL ANALYSIS\n- Consistency between Analytics, Performance, SEO, and Technical aspects\n- Identification of important correlations\n- Friction points in the user experience\n- Cross-channel improvement opportunities\n\n🚀 PRIORITIZED ACTION PLAN (90 DAYS)\n- WEEK 1-2: Critical actions (immediate impact)\n- MONTH 1: Fundamental optimizations\n- MONTHS 2-3: Development and growth\n\n💰 ROI AND MEASURABLE GOALS\n- 30/60/90-day traffic goals\n- Priority KPIs to track\n- Estimated resources/budget required\n- Expected business impact\n\n🔍 MONITORING AND ALERTS\n- Metrics to monitor monthly\n- Alert thresholds to configure\n- Corrective actions in case of degradation\n\nRESPONSE FORMAT:\nStructure your response with emojis, clear sections, and highly actionable recommendations. Conclude with a tracking dashboard featuring 5 main KPIs.\n\nIMPORTANT: Be precise, actionable, and tailor your recommendations to the AI/tech sector.\n",
"options": {
"systemMessage": "Tu réponds uniquement en français. Sois précis, actionnable et orienté résultats. Utilise des données chiffrées quand possible."
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "734dd3f2-b839-45b8-816e-55537d49fa46",
"name": "获取 GA 历史记录",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-2740,
-1120
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "lmJOtRvKMOD3WkGJ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "c2fc9adc-ea41-4487-b3a9-8aa8c9958363",
"name": "获取 Search Console 历史记录",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-2740,
-320
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "lmJOtRvKMOD3WkGJ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "f3d33302-cd1d-40f0-9582-f0af420ad4dd",
"name": "获取 PageSpeed 历史记录",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-2740,
-720
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "lmJOtRvKMOD3WkGJ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "fd76ab3f-ed79-46b9-9ff6-d5ba1d00d71b",
"name": "获取技术审计历史记录",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-2740,
180
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "lmJOtRvKMOD3WkGJ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "aca46735-6331-49e9-b4e7-5a8aff96b23d",
"name": "保存最终报告到表格",
"type": "n8n-nodes-base.googleSheets",
"position": [
-1180,
-640
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "lmJOtRvKMOD3WkGJ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "0571f8a4-b8da-4025-98f5-82586847d996",
"name": "获取报告",
"type": "n8n-nodes-base.googleAnalytics",
"position": [
-3340,
-1240
],
"parameters": {
"metricsGA4": {
"metricValues": [
{}
]
},
"propertyId": {
"__rl": true,
"mode": "list",
"value": ""
},
"dimensionsGA4": {
"dimensionValues": [
{}
]
},
"additionalFields": {}
},
"credentials": {
"googleAnalyticsOAuth2": {
"id": "IdJyLR8hvyqvt2XQ",
"name": "Google Analytics account"
}
},
"typeVersion": 2
},
{
"id": "3e1cf038-fe51-4938-a963-b44e476c8b9b",
"name": "在 Google Sheets 中获取行",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-2620,
-720
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "lmJOtRvKMOD3WkGJ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "7e0f155e-47d4-42bc-b5d9-ccd8af2fc320",
"name": "在 Google Sheets1 的工作表中获取行",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-2620,
-320
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "lmJOtRvKMOD3WkGJ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "f075de2e-af7a-49c7-8fca-4b61d2147b44",
"name": "在 Google Sheets2 的工作表中获取行",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-2620,
180
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "lmJOtRvKMOD3WkGJ",
"name": "Google Sheets account"
}
},
"typeVersion": 4.6
},
{
"id": "dec783ed-8df6-440a-87b2-a114db375be0",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-4840,
-1220
],
"parameters": {
"color": 5,
"width": 1180,
"height": 920,
"content": "# 🚀 自动化 SEO 审计:设置与概述"
},
"typeVersion": 1
},
{
"id": "f6e8b2f2-a7eb-478f-b435-f7d3d718c420",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3640,
-1740
],
"parameters": {
"color": 4,
"width": 700,
"height": 1940,
"content": "# 1. 数据收集阶段"
},
"typeVersion": 1
},
{
"id": "1ee5c1d8-deb5-453c-96fa-1861e70f6960",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2920,
-1740
],
"parameters": {
"width": 580,
"height": 2100,
"content": "# 2. 专家 AI 分析"
},
"typeVersion": 1
},
{
"id": "c2525899-4b56-4c73-8ae6-6814cce13820",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2320,
-1000
],
"parameters": {
"color": 3,
"width": 1020,
"height": 780,
"content": "# 3. 汇总与主合成"
},
"typeVersion": 1
},
{
"id": "b1a0957f-fe63-499d-8764-57638a26309d",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1280,
-880
],
"parameters": {
"width": 440,
"height": 500,
"content": "# 4. 最终输出与存储"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Merge": {
"main": [
[
{
"node": "Aggregate All Reports",
"type": "main",
"index": 0
}
]
]
},
"Append row": {
"ai_tool": [
[
{
"node": "Analytics Specialist Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get row(s)4": {
"ai_tool": [
[
{
"node": "Master Analyst Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get a report": {
"main": [
[
{
"node": "Format GA Data",
"type": "main",
"index": 0
}
]
]
},
"Format GA Data": {
"main": [
[
{
"node": "Analytics Specialist Agent",
"type": "main",
"index": 0
}
]
]
},
"Get GA History": {
"ai_tool": [
[
{
"node": "Analytics Specialist Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Search console": {
"main": [
[
{
"node": "Format Search Console Data",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Set Target Website",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Analytics Specialist Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Score On-Page SEO": {
"main": [
[
{
"node": "Technical Audit Agent",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "SEO Specialist Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model2": {
"ai_languageModel": [
[
{
"node": "Performance Specialist Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model3": {
"ai_languageModel": [
[
{
"node": "Technical Audit Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model4": {
"ai_languageModel": [
[
{
"node": "Master Analyst Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Set Target Website": {
"main": [
[
{
"node": "Get a report",
"type": "main",
"index": 0
},
{
"node": "Fetch PageSpeed Data",
"type": "main",
"index": 0
},
{
"node": "Search console",
"type": "main",
"index": 0
},
{
"node": "Crawl Website Homepage",
"type": "main",
"index": 0
}
]
]
},
"Fetch PageSpeed Data": {
"main": [
[
{
"node": "Format PageSpeed Data",
"type": "main",
"index": 0
}
]
]
},
"Master Analyst Agent": {
"main": [
[
{
"node": "Save Final Report to Sheet",
"type": "main",
"index": 0
}
]
]
},
"SEO Specialist Agent": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 2
}
]
]
},
"Aggregate All Reports": {
"main": [
[
{
"node": "Master Analyst Agent",
"type": "main",
"index": 0
}
]
]
},
"Format PageSpeed Data": {
"main": [
[
{
"node": "Performance Specialist Agent",
"type": "main",
"index": 0
}
]
]
},
"Get PageSpeed History": {
"ai_tool": [
[
{
"node": "Performance Specialist Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Technical Audit Agent": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 3
}
]
]
},
"Crawl Website Homepage": {
"main": [
[
{
"node": "Extract On-Page SEO Data",
"type": "main",
"index": 0
}
]
]
},
"Extract On-Page SEO Data": {
"main": [
[
{
"node": "Score On-Page SEO",
"type": "main",
"index": 0
}
]
]
},
"Analytics Specialist Agent": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Format Search Console Data": {
"main": [
[
{
"node": "SEO Specialist Agent",
"type": "main",
"index": 0
}
]
]
},
"Get Search Console History": {
"ai_tool": [
[
{
"node": "SEO Specialist Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get Technical Audit History": {
"ai_tool": [
[
{
"node": "Technical Audit Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Performance Specialist Agent": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Get row(s) in sheet in Google Sheets": {
"ai_tool": [
[
{
"node": "Performance Specialist Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get row(s) in sheet in Google Sheets1": {
"ai_tool": [
[
{
"node": "SEO Specialist Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get row(s) in sheet in Google Sheets2": {
"ai_tool": [
[
{
"node": "Technical Audit Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 市场调研, AI 摘要总结
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
带 AI 过滤的个性化学习内容聚合器
使用 GPT-4.1-mini 和 Google Sheets 从 Reddit 和 RSS 筛选学习内容
Set
Code
Merge
+7
18 节点higashiyama
市场调研
使用GPT-4洞察和Slack交付自动化每周SEO报告
通过GPT-4洞察和Slack交付自动化每周SEO报告
Set
Code
Merge
+8
42 节点Marcelo Abreu
市场调研
新抓取器_TechCrunch新闻-AI1
TechCrunch AI文章抓取与分类器,使用GPT-4.1-nano到Sheets和Telegram
Set
Code
Html
+12
18 节点Mujahid Kabae
市场调研
AI内容侦察 - 每周竞品博客和新闻摘要
每周竞品内容摘要(Gemini和OpenAI、Google Sheets和Firecrawl)
Code
Gmail
Split Out
+9
22 节点Michael Yang
市场调研
多平台阿联酋房地产线索生成与GPT-4分析
多平台阿联酋房地产线索生成系统,集成GPT-4分析
Set
Code
Merge
+6
20 节点papcy
潜在客户开发
使用GPT-4o、Sheets和Slack自动化月度Google Ads性能分析
使用GPT-4o、Sheets和Slack自动化月度Google Ads性能分析
Code
Slack
Http Request
+5
13 节点Nikan Noorafkan
市场调研