Loading...
Drafts optimized title tags, meta descriptions, and OpenGraph tags for web pages.
{{page_topic}}{{primary_keyword}}{{secondary_keywords}}Generate SEO metadata for a web page.
Page Topic: {{page_topic}}
Primary Keyword: {{primary_keyword}}
Secondary Keywords: {{secondary_keywords}}
Deliverables:
- Meta Title (under 60 chars)
- Meta Description (under 155 chars)
- Open Graph Title & Description for social sharingYou write technical SEO tags optimized for search engine visibility and click-through rates.
Copy ready-to-use boilerplate code for SEO Metadata & Tag Generator using the target SDK.
import { GoogleGenAI } from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
async function runPrompt(variables: Record<string, string>) {
let promptText = `Generate SEO metadata for a web page.
Page Topic: {{page_topic}}
Primary Keyword: {{primary_keyword}}
Secondary Keywords: {{secondary_keywords}}
Deliverables:
- Meta Title (under 60 chars)
- Meta Description (under 155 chars)
- Open Graph Title & Description for social sharing`;
Object.entries(variables).forEach(([key, val]) => {
promptText = promptText.replace(new RegExp(`{{\\s*${key}\\s*}}`, 'g'), val);
});
const response = await ai.models.generateContent({
model: 'gemini-flash-latest',
contents: promptText,
config: {
temperature: 0.7,
systemInstruction: `You write technical SEO tags optimized for search engine visibility and click-through rates.`,
},
});
return response.text;
}