„ChatGpt“ yra ne tik raginimo ir atsakymo platforma. Galite atsiųsti raginimus paprašyti pagalbos naudojant SEO, tačiau tai tampa galingesnė tuo metu, kai jūs patys sukuriate savo agentą.
Aš atlieku daugybę SEO auditų – tai būtina įmonės svetainei – todėl ieškojau būdo, kaip supaprastinti kai kuriuos iš šių procesų.
Kaip aš tai padariau? Sukūręs „ChatGpt“ agentą, kuriuo pasidalinsiu su jumis, kad galėtumėte pritaikyti ir pakeisti jį, kad patenkintumėte jūsų poreikius.
Aš laikysiuosi kuo „beatodairiškesnio“, bet tiesiog vykdysiu instrukcijas, ir viskas turėtų veikti.
Aš paaiškinsiu šiuos veiksmus “
- Savo „ChatGpt“ konfigūracija.
- Savo „CloudFlare“ kodo sukūrimas, kad gautumėte puslapio HTML duomenis.
- Savo SEO audito agentų nustatymas.
Pabaigoje turėsite robotą, kuriame pateikiama informacija, pavyzdžiui::

Remdamiesi agento išvadomis, taip pat gausite veiksmingų veiksmų, kuriuos reikia atlikti, sąrašą.
Sukurti „Cloudflare“ puslapių darbuotoją jūsų agentui
„CloudFlare“ puslapių darbuotojai padeda jūsų agentui rinkti informaciją iš svetainės, kurią bandote analizuoti ir peržiūrėti dabartinę SEO būklę.
Norėdami pradėti, galite naudoti nemokamą sąskaitą, o galite registruotis atlikdami šiuos dalykus:
- Eiti į http://pages.dev/
- Sukurti sąskaitą
Aš naudojau „Google“ prisiregistruoti, nes lengviau, tačiau pasirinkite metodą, kuris jums labiausiai patinka. Jūs pateksite į ekraną, kuris atrodo maždaug taip:

Eikite į Pridėti> darbuotojai.

Tada galite pasirinkti šabloną, importuoti saugyklą arba pradėti nuo „Hello World“! Aš pasirinkau „Hello World“ variantą, nes tai yra lengviausia naudoti.

Eikite per kitą ekraną ir paspauskite “Diegti“. Jūs pateksite į ekraną, kuriame sakoma: „Sėkmė! Jūsų projektas dislokuotas regionui: Žemė. “
Negalima spustelėti šio puslapio.
Vietoj to, spustelėkite “Redaguoti kodą„Pašalinkite visą esamą kodą ir įveskite šį kodą į redaktorių:
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const { searchParams } = new URL(request.url);
const targetUrl = searchParams.get('url');
const userAgentName = searchParams.get('user-agent');
if (!targetUrl) {
return new Response(
JSON.stringify({ error: "Missing 'url' parameter" }),
{ status: 400, headers: { 'Content-Type': 'application/json' } }
);
}
const userAgents = {
googlebot: 'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.6167.184 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
samsung5g: 'Mozilla/5.0 (Linux; Android 13; SM-S901B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36',
iphone13pmax: 'Mozilla/5.0 (iPhone14,3; U; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/19A346 Safari/602.1',
msedge: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246',
safari: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9',
bingbot: 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) Chrome/',
chrome: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36',
};
const userAgent = userAgents(userAgentName) || userAgents.chrome;
const headers = {
'User-Agent': userAgent,
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding': 'gzip',
'Cache-Control': 'no-cache',
'Pragma': 'no-cache',
};
try {
let redirectChain = ();
let currentUrl = targetUrl;
let finalResponse;
// Follow redirects
while (true) {
const response = await fetch(currentUrl, { headers, redirect: 'manual' });
// Add the current URL and status to the redirect chain only if it's not already added
if (!redirectChain.length || redirectChain(redirectChain.length - 1).url !== currentUrl) {
redirectChain.push({ url: currentUrl, status: response.status });
}
// Check if the response is a redirect
if (response.status >= 300 && response.status < 400 && response.headers.get('location')) {
const redirectUrl = new URL(response.headers.get('location'), currentUrl).href;
currentUrl = redirectUrl; // Follow the redirect
} else {
// No more redirects; capture the final response
finalResponse = response;
break;
}
}
if (!finalResponse.ok) {
throw new Error(`Request to ${targetUrl} failed with status code: ${finalResponse.status}`);
}
const html = await finalResponse.text();
// Robots.txt
const domain = new URL(targetUrl).origin;
const robotsTxtResponse = await fetch(`${domain}/robots.txt`, { headers });
const robotsTxt = robotsTxtResponse.ok ? await robotsTxtResponse.text() : 'robots.txt not found';
const sitemapMatches = robotsTxt.match(/Sitemap:\s*(https?:\/\/(^\s)+)/gi) || ();
const sitemaps = sitemapMatches.map(sitemap => sitemap.replace('Sitemap: ', '').trim());
// Metadata
const titleMatch = html.match(/<title(^>)*>\s*(.*?)\s*<\/title>/i);
const title = titleMatch ? titleMatch(1) : 'No Title Found';
const metaDescriptionMatch = html.match(/<meta\s+name=("')description("')\s+content=("')(.*?)("')\s*\/?>/i);
const metaDescription = metaDescriptionMatch ? metaDescriptionMatch(1) : 'No Meta Description Found';
const canonicalMatch = html.match(/<link\s+rel=('")canonical('")\s+href=('")(.*?)('")\s*\/?>/i);
const canonical = canonicalMatch ? canonicalMatch(1) : 'No Canonical Tag Found';
// Open Graph and Twitter Info
const ogTags = {
ogTitle: (html.match(/<meta\s+property="og:title"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(1) || 'No Open Graph Title',
ogDescription: (html.match(/<meta\s+property="og:description"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(1) || 'No Open Graph Description',
ogImage: (html.match(/<meta\s+property="og:image"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(1) || 'No Open Graph Image',
};
const twitterTags = {
twitterTitle: (html.match(/<meta\s+(name|property)="twitter:title"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Title',
twitterDescription: (html.match(/<meta\s+(name|property)="twitter:description"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Description',
twitterImage: (html.match(/<meta\s+(name|property)="twitter:image"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Image',
twitterCard: (html.match(/<meta\s+(name|property)="twitter:card"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Card Type',
twitterCreator: (html.match(/<meta\s+(name|property)="twitter:creator"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Creator',
twitterSite: (html.match(/<meta\s+(name|property)="twitter:site"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Site',
twitterLabel1: (html.match(/<meta\s+(name|property)="twitter:label1"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Label 1',
twitterData1: (html.match(/<meta\s+(name|property)="twitter:data1"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Data 1',
twitterLabel2: (html.match(/<meta\s+(name|property)="twitter:label2"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Label 2',
twitterData2: (html.match(/<meta\s+(name|property)="twitter:data2"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Data 2',
twitterAccountId: (html.match(/<meta\s+(name|property)="twitter:account_id"\s+content="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"\s*\/?>/i) || ())(2) || 'No Twitter Account ID',
};
// Headings
const headings = {
h1: (...html.matchAll(/<h1(^>)*>(.*?)<\/h1>/gis)).map(match => match(1)),
h2: (...html.matchAll(/<h2(^>)*>(.*?)<\/h2>/gis)).map(match => match(1)),
h3: (...html.matchAll(/<h3(^>)*>(.*?)<\/h3>/gis)).map(match => match(1)),
};
// Images
const imageMatches = (...html.matchAll(/<img\s+(^>)*src="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"(^>)*>/gi));
const images = imageMatches.map(img => img(1));
const imagesWithoutAlt = imageMatches.filter(img => !/alt=".*?"/i.test(img(0))).length;
// Links
const linkMatches = (...html.matchAll(/<a\s+(^>)*href="https://www.searchenginejournal.com/create-your-own-chatgpt-agent-for-on-page-seo-audits/546016/(.*?)"(^>)*>/gi));
const links = {
internal: linkMatches.filter(link => link(1).startsWith(domain)).map(link => link(1)),
external: linkMatches.filter(link => !link(1).startsWith(domain) && link(1).startsWith('http')).map(link => link(1)),
};
// Schemas (JSON-LD)
const schemaJSONLDMatches = (...html.matchAll(/<script(^>)*type="application\/ld\+json"(^>)*>(.*?)<\/script>/gis));
const schemas = schemaJSONLDMatches.map(match => {
try {
return JSON.parse(match(1).trim());
} catch {
return { error: "Invalid JSON-LD", raw: match(1).trim() };
}
});
// Microdata
const microdataMatches = (...html.matchAll(/<(^>)*itemscope(^>)*>/gi));
const microdata = microdataMatches.map(scope => {
const typeMatch = scope(0).match(/itemtype=("')(.*?)("')/i);
return {
type: typeMatch ? typeMatch(1) : 'Unknown',
raw: scope(0),
};
});
// Response Headers
const responseHeaders = Array.from(finalResponse.headers.entries());
// Construct final JSON output
return new Response(
JSON.stringify({
targetUrl,
redirectChain,
sitemaps,
metadata: { title, metaDescription, canonical },
headings,
schemas,
openGraph: ogTags,
twitterCards: twitterTags,
images: { total: images.length, withoutAlt: imagesWithoutAlt, imageURLs: images },
links,
microdata,
robotsTxt,
responseHeaders,
//rawHTML: html,
}),
{ headers: { 'Content-Type': 'application/json' } }
);
} catch (error) {
return new Response(
JSON.stringify({ error: error.message }),
{ status: 500, headers: { 'Content-Type': 'application/json' } }
);
}
}
Šiuo metu turite atlikti du dalykus:
- Nukopijuokite URL savo darbuotojui.
- Distatykite savo darbuotoją.
Tai yra URL, kurio jums reikės kitame skyriuje. Tai galite rasti čia:

Būtinai paspauskite “Diegti“Prieš išeidami iš ekrano. Jei šiame etape norite pamatyti pagrindinę išvestį, galite.
Įklijuokite savo URL į naršyklę ir pridėkite šiuos dalykus po /?url=https://www.searchenginejournal.com.
Jūsų URL atrodys maždaug taip: https://yoururl.workers.dev/?url=https://searchenginejournal.com.
Keiskite URL į vieną iš jūsų pasirinktų tai išbandyti. Šiame etape tai nėra „gražiausia“, todėl atėjo laikas pereiti prie linksmos savo GPT konfigūravimo dalies.
Pastaba: Šis darbuotojas nedirba su „JavaScript“ pateiktomis svetainėmis. Bet visiems kitiems, naudojantiems šį agentą, jis turėtų veikti gerai. Nesivaržykite patobulinti tai, kad dirbtumėte su „JavaScript“ pateikimu.
Savo GPT konfigūravimas imituoti mano agentą
Pirmiausia turite sukonfigūruoti GPT, ir tai galite padaryti atidarę „ChatGpt“ ir eidami į “Naršykite GPTS“Arba galite tiesiog sekti šią nuorodą.

Tada eisi į “+ Kurti„:

Dabar sakoma „kurti“ ir „konfigūruoti“. Eik į Konfigūruokite Ir pradėkite prijungti savo informaciją.
Galite nedvejodami šiek tiek pakeisti reikalus, tačiau rekomenduoju sekti viską, ką pridedu žemiau, kad sukurtumėte savo auditoriaus pagrindą.
Šiame skyriuje pridėsite tai, ką ketinu išvardyti:

Name: OnPage SEO Audit
Description: Analyze SEO performance of any webpage using custom user-agents. Get detailed insights into metadata, redirect chains, Open Graph tags, Twitter Cards, sitemaps, and more. Perfect for SEO professionals and developers.
Instructions:
Trigger: When a user submits a URL (required) and an optional user-agent:
Instruction: Use the provided inputs to make an API request to retrieve SEO data. Default to the chrome user-agent if not provided.
Trigger: When the API returns valid data:
Instruction: Analyze the data and provide:
A summary of the page's SEO performance.
Actionable suggestions for improvement, categorized into metadata, technical SEO, and content.
Follow-up questions to clarify user priorities or goals, such as:
"Do you have specific goals for this page, such as improving search visibility, click-through rates, or user engagement?"
"Would you like me to focus on technical SEO or content-related improvements first?"
Example Response:
"The page's meta description is missing, which can impact click-through rates. Would you like me to suggest a draft description?"
Trigger: When the API returns HTTP 403:
Instruction:
Retry the request using the chrome user-agent.
If the issue persists:
Notify the user of the problem.
Suggest verifying the URL or user-agent compatibility.
Trigger: When the API returns a 400 error:
Instruction:
Clearly explain the error and provide actionable steps to resolve it (e.g., verify the URL format or ensure required parameters are provided).
Trigger: When data is incomplete or missing:
Instruction:
Request additional information from the user or permission to explore fallback data sources.
Example Follow-Up:
"The API response is missing a meta description for this page. Can you confirm if this was intentional, or should we explore other sources?"
Additional Guidelines:
Include:
A categorized summary of the page's SEO performance (e.g., metadata, technical SEO, content).
A prioritized list of recommended actions.
Visual examples or detailed explanations, when applicable.
Proactively address multiple detected issues with follow-up questions:
"The page has several critical issues, including missing Open Graph tags and a non-canonical URL. Would you like me to prioritize recommendations for social media or canonicalization first?"
Conversation starters
User-Agent: Googlebot, URL: https://example.com
Analyze the SEO details for https://example.com using Googlebot.
Analyze the page using the Samsung Galaxy S22 user-agent.
What metadata is available for https://example.com with Chrome?
Capabilities
Web Search
Code Interpreter & Data Analysis
Šiuo metu jūsų konfigūracija turėtų atrodyti taip:

Peržiūrėkite visas šias laukus ir pažiūrėkite, ar prieš pereidami prie kiekvieno apgyvendinimo tinkamai Sukurkite naują veiksmą.
Eikite į Autentifikavimas Ir rinktis Nėra.

Pridėkite šį „ChatGPt“ veiksmo kodavimą prie schemos lauko, tačiau būtinai pakeiskite Serveriai> URL laukas jūsų URL. Aš jį pavadinsiu „https://changetoyourl.com/“, kad jums būtų lengva rasti.
{
"openapi": "3.1.0",
"info": {
"title": "Enhanced SEO Analysis and Audit API",
"description": "Fetch SEO data for analysis. Use the returned data to generate actionable SEO recommendations using AI or experts.",
"version": "1.2.0"
},
"servers": (
{
"url": "https://CHANGETOYOURURL.com/",
"description": "Base URL for Enhanced SEO Analysis API"
}
),
"paths": {
"/": {
"get": {
"operationId": "fetchAndAuditSEOData",
"summary": "Fetch and Audit SEO Data",
"description": "Retrieve SEO analysis data using a user-agent and URL and perform a basic SEO audit.",
"parameters": (
{
"name": "user-agent",
"in": "query",
"description": "The user-agent for the request.",
"required": true,
"schema": {
"type": "string",
"enum": ("chrome", "googlebot", "iphone13pmax", "samsung5g")
}
},
{
"name": "url",
"in": "query",
"description": "The URL of the webpage to analyze.",
"required": true,
"schema": {
"type": "string",
"format": "uri"
}
}
),
"responses": {
"200": {
"description": "Successful response with audit results",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"metadata": {
"type": "object",
"properties": {
"title": { "type": "string" },
"metaDescription": { "type": "string" },
"canonical": { "type": "string" }
}
},
"redirectChain": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": { "type": "string" },
"status": { "type": "integer" }
}
}
},
"openGraph": {
"type": "object",
"properties": {
"ogTitle": { "type": "string" },
"ogDescription": { "type": "string" },
"ogImage": { "type": "string" }
}
},
"twitterCards": {
"type": "object",
"properties": {
"twitterTitle": { "type": "string" },
"twitterDescription": { "type": "string" },
"twitterImage": { "type": "string" }
}
},
"sitemaps": {
"type": "array",
"items": { "type": "string" }
},
"robotsTxt": {
"type": "string"
},
"audit": {
"type": "object",
"properties": {
"issues": {
"type": "array",
"items": { "type": "string" }
},
"recommendations": {
"type": "array",
"items": { "type": "string" }
}
}
},
"auditSummary": {
"type": "array",
"items": {
"type": "string"
}
},
"nextSteps": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": { "type": "string" }
}
}
}
}
}
}
}
}
}
}
Turėtumėte tai pamatyti skyrelyje „Galimi veiksmai: fetchandauditseodata“.
Po Privatumo politikapridėkite nuorodą į savo privatumo politiką.
Galiausiai bakstelėkite “Sukurti“Viršuje dešinėje ir vykdykite raginimus.
Dabar galite peržiūrėti savo GPT; Tai bus panašu į šį puslapio SEO audito GPT.
Testuokite savo GPT ir susipažinkite su savo galimybėmis
Jūs nuėjote ilgą kelią su savo GPT, ir laikas išbandyti dalykus.
Bakstelėkite antrąją plytelę, „Išanalizuokite SEO detales“. Jis numatytas pagal pavyzdį.com, tačiau galite jį paskelbti, kad išbandytumėte jums patinkantį URL.
Pabandykime: „Netflix.com“ ragindami: „Naudokite Netflix.com kaip URL“.

Dabar galite eksperimentuoti su bet kuria iš galimų GPT parinkčių, kad pamatytumėte, kaip viskas veikia kartu.
Toliau pritaikykite savo GPT
Galbūt norėsite dar labiau pritaikyti savo GPT, grįždami ten, kur jį sukūrėte, ir atnaujindami keletą dalykų.
Atnaujinkite savo pokalbio pradedančiuosius, kad pakoreguotumėte:
- Vartotojo agentai.
- Redaguokite instrukcijas, kad geriau patenkintumėte savo poreikius, pridėdami trigerius ir atsakymus.
Jei norite, eikite į savo darbuotojo kodavimą ir pridėkite prie „Const Useragents“, kad į sąrašą įtrauktumėte daugiau vartotojų agentų.
Dabar galite kreiptis į savo pasirinktinį GPT agentą ir tiesiog paraginti jį į tai, kurį puslapį nuskaityti toliau.
Tai lengva padaryti, paskatinus ką nors tokio: „Pakeiskite URL į„ ThedesiredUrl ““, o jūsų agentas pradės dirbti už jus.
Apibendrinant
Šis pasirinktinis GPT agentas yra tik vienas iš pavyzdžių, kaip „ChatGPT“ derinimas su „CloudFlare“ darbuotojais gali supaprastinti pagrindines SEO užduotis.
Eksperimentuokite su agentu ir pakeiskite jį pagal savo poreikius.
PG gali padėti atlikti daugybę užduočių ir čia reikia pasilikti. Taigi, panaudojant šią technologiją kaip asistentą, o veiksminga priemonė turi galimybių padėti SEO būti veiksmingesnėmis mastu.
Daugiau išteklių:
Pateiktas vaizdas: „ImageFlow“/„Shutterstock“