Skip to content

Ayo marketing – Halo, kamu! Apakah kamu sedang mencari cara untuk meningkatkan brand awareness atau kesadaran merek untuk bisnis atau produk kamu? Jika iya, maka kamu perlu mencoba strategi pemasaran yang sedang populer saat ini, yaitu menggunakan influencer marketing.

import React, { useState, useEffect, useRef } from ‘react’; import { BookOpen, Lightbulb, ScrollText, Gift, Sparkles, Search, Loader2, CheckCircle2, Download, FileText, AlertCircle, ChevronRight, Type, RefreshCw, Calendar, Target, Image } from ‘lucide-react’; // — CONFIGURATION & CONSTANTS — const apiKey = “”; // API key is injected by the environment const CATEGORIES = [ { id: ‘tutorial’, label: ‘📖 Tutorial Islami’, icon: BookOpen, desc: ‘Panduan Ibadah & Tata Cara Jenazah’, reqInput: false }, { id: ‘info’, label: ‘💡 Informasi Islami’, icon: Lightbulb, desc: ‘Wawasan Agama Islam’, reqInput: false }, { id: ‘sejarah’, label: ‘📜 Sejarah Islam’, icon: ScrollText, desc: ‘Kisah Tokoh & Peristiwa Besar’, reqInput: false }, { id: ‘promo’, label: ‘🎁 Promosi’, icon: Gift, desc: ‘Promo, Event & Diskon’, reqInput: true, placeholder: ‘Contoh: Promo Ramadhan diskon 20% untuk pembelian lahan tipe double, berlaku sampai akhir bulan…’ }, { id: ‘custom’, label: ‘✨ Custom Artikel’, icon: Sparkles, desc: ‘Masukkan sendiri point-pointnya’, reqInput: true, placeholder: ‘Masukkan poin-poin utama yang ingin dibahas dalam artikel…’ }, ]; // — HELPER: API CALL WITH RETRY — const fetchWithRetry = async (url, options, retries = 5) => { const delays = [1000, 2000, 4000, 8000, 16000]; for (let i = 0; i < retries; i++) { try { const response = await fetch(url, options); if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`); return await response.json(); } catch (error) { if (i === retries - 1) throw error; await new Promise(res => setTimeout(res, delays[i])); } } }; // — MAIN COMPONENT — export default function App() { const [recommendedKeywords, setRecommendedKeywords] = useState([]); const [isLoadingKeywords, setIsLoadingKeywords] = useState(false); const [selectedCategory, setSelectedCategory] = useState(null); const [customInput, setCustomInput] = useState(“”); const [generatedTitles, setGeneratedTitles] = useState([]); const [selectedTitle, setSelectedTitle] = useState(“”); const [articleData, setArticleData] = useState(null); const [isLoadingTitles, setIsLoadingTitles] = useState(false); const [isLoadingArticle, setIsLoadingArticle] = useState(false); const [error, setError] = useState(null); const [showToast, setShowToast] = useState(false); const resultRef = useRef(null); const dateGenerate = new Date().toLocaleDateString(‘id-ID’, { weekday: ‘long’, year: ‘numeric’, month: ‘long’, day: ‘numeric’ }); // — FETCH DYNAMIC KEYWORDS — const fetchKeywords = async () => { setIsLoadingKeywords(true); const prompt = ` Sebagai pakar SEO untuk niche Pemakaman Islam, hasilkan 5 rekomendasi long-tail keyword bahasa Indonesia yang relevan dengan Al Azhar Memorial Garden (pemakaman islam, adab ziarah, biaya pemakaman, dll). Pilih keyword dengan “High Volume” & “Low Competition”. Kembalikan HANYA array of JSON dengan format: [{“keyword”: “contoh keyword”, “volume”: “angka pencarian misal 1.200”}] `; try { const payload = { contents: [{ parts: [{ text: prompt }] }], generationConfig: { responseMimeType: “application/json” } }; const data = await fetchWithRetry( `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-09-2025:generateContent?key=${apiKey}`, { method: “POST”, headers: { “Content-Type”: “application/json” }, body: JSON.stringify(payload) } ); const responseText = data.candidates?.[0]?.content?.parts?.[0]?.text; if (responseText) { setRecommendedKeywords(JSON.parse(responseText)); } } catch (err) { console.error(err); setRecommendedKeywords([ { keyword: “Syarat pemakaman Islam”, volume: “1.200” }, { keyword: “Adab ziarah kubur sunnah”, volume: “3.200” }, { keyword: “Hukum lahan makam”, volume: “850” }, { keyword: “Biaya pemakaman Karawang”, volume: “900” }, { keyword: “Keutamaan memuliakan jenazah”, volume: “1.400” }, ]); } finally { setIsLoadingKeywords(false); } }; useEffect(() => { fetchKeywords(); }, []); // — API FUNCTIONS — const generateTitles = async () => { if (!selectedCategory) { setError(“Pilih kategori artikel terlebih dahulu.”); return; } if (selectedCategory.reqInput && !customInput.trim()) { setError(“Mohon isi detail/poin untuk kategori ini.”); return; } setError(null); setIsLoadingTitles(true); setGeneratedTitles([]); setSelectedTitle(“”); setArticleData(null); const categoryContext = selectedCategory.reqInput ? `Konteks/Poin bahasan yang WAJIB dibahas: ${customInput}` : `ATURAN PEMBUATAN JUDUL: – Buat Judul 1: Berhubungan spesifik dengan pemakaman, kematian, atau pengurusan jenazah dalam Islam. – Buat Judul 2 & 3: Topik Islami GLOBAL yang sedang tren dan memiliki keyword pencarian sangat tinggi (misal: doa sehari-hari, kisah nabi, hukum fiqih umum, dll). TIDAK PERLU berhubungan dengan pemakaman.`; const prompt = ` Buatkan 3 alternatif judul artikel SEO yang sangat menarik (mengandung power words, angka, atau sentimen) untuk blog Al Azhar Memorial Garden. Kategori: ${selectedCategory.label} ${categoryContext} Hanya kembalikan array JSON berisi 3 string judul. Format: [“Judul 1”, “Judul 2”, “Judul 3”] `; try { const payload = { contents: [{ parts: [{ text: prompt }] }], generationConfig: { responseMimeType: “application/json” } }; const data = await fetchWithRetry( `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-09-2025:generateContent?key=${apiKey}`, { method: “POST”, headers: { “Content-Type”: “application/json” }, body: JSON.stringify(payload) } ); const responseText = data.candidates?.[0]?.content?.parts?.[0]?.text; if (responseText) { setGeneratedTitles(JSON.parse(responseText)); } else { throw new Error(“Gagal mendapatkan respon.”); } } catch (err) { setError(“Gagal membuat judul. Silakan coba lagi.”); } finally { setIsLoadingTitles(false); } }; const generateArticle = async () => { if (!selectedTitle) return; setError(null); setIsLoadingArticle(true); setArticleData(null); const systemInstruction = `Anda adalah Expert SEO Content Writer spesialis niche Islami dan Pemakaman, bekerja untuk Prana (Marketing Manager Al Azhar Memorial Garden). Profil & Selling Points AMG: – Pemakaman muslim #1 di Indonesia, Karawang (10 menit dari MBZ exit). 100% syariah (hanya muslim), sertifikat arah kiblat Kemenag. – Zero-pungli, keamanan 24 jam. – Walkway/jalan setapak lebar (makam tak terinjak), ramah kursi roda. – Bebas biaya pemeliharaan rumput selamanya. – Fasilitas premium: Tenda/kursi/payung gratis, aula, masjid indoor AC & outdoor, toilet bersih. ATURAN FORMAT HTML SANGAT KETAT: 1. ARTIKEL WAJIB MEMILIKI MINIMAL 600 KATA. 2. PARAGRAF PERTAMA WAJIB PERSIS DIMULAI DENGAN KODE HTML INI (Jangan diubah):

Al Azhar Memorial Garden – [lanjutan isi paragraf pertama]…

3. SETIAP PARAGRAF BARU WAJIB DIBUNGKUS DENGAN TAG

. JANGAN ADA TEKS YANG MENGGANTUNG TANPA TAG

. JANGAN GUNAKAN
UNTUK PARAGRAF BARU! 4. Gunakan tag

untuk Subheading Utama. 5. Gunakan tag

untuk Sub-subheading. 6. Gunakan tag

untuk Poin-poin kecil (jika ada). 7. Jika ada kutipan ayat/doa, wajib gunakan format berikut:

[Teks Arab di sini]

[Teks Transliterasi Latin di sini]

“[Arti dari ayat/doa tersebut]” (Sumber).

`; const prompt = ` Buat artikel SEO komprehensif berdasarkan: Judul Pilihan Utama: “${selectedTitle}” Kategori: ${selectedCategory.label} ${selectedCategory.reqInput ? `Poin Khusus: ${customInput}` : ”} Kembalikan data dalam format JSON yang strict mengikuti schema ini: { “strategiKeyword”: { “utama”: “Keyword fokus utama”, “tambahan”: [“Keyword tambahan 1”, “Keyword tambahan 2”] }, “judulArtikel”: { “utama”: “${selectedTitle}”, “alternatif1”: “Ide judul alternatif 1”, “alternatif2”: “Ide judul alternatif 2” }, “artikelHTML”: “Isi artikel dalam format HTML semantic. Ingat aturan

dan tag

,

,

yang ketat.”, “snippet”: { “metaTitle”: “Max 60 chars, powerwords”, “metaDescription”: “Max 160 chars, mengandung keyword utama”, “url”: “https://alazharmemorialgarden.com/slug-url-pendek” }, “promptAI”: “Prompt bahasa inggris detail untuk AI Image Generator (Midjourney/Dall-E) rasio 3:2” } `; try { const payload = { contents: [{ parts: [{ text: prompt }] }], systemInstruction: { parts: [{ text: systemInstruction }] }, generationConfig: { responseMimeType: “application/json” } }; const data = await fetchWithRetry( `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-09-2025:generateContent?key=${apiKey}`, { method: “POST”, headers: { “Content-Type”: “application/json” }, body: JSON.stringify(payload) } ); const responseText = data.candidates?.[0]?.content?.parts?.[0]?.text; if (responseText) { let parsedData = JSON.parse(responseText); // — PREPROCESSING FALLBACK (Jika AI masih lupa membungkus paragraf atau menaruh link AMG) — let htmlContent = parsedData.artikelHTML; // 1. Convert double line-breaks to

tags if AI just outputs raw text with newlines if (htmlContent.includes(‘\n’) && !htmlContent.includes(‘

‘)) { htmlContent = htmlContent.split(/\n+/).filter(p => p.trim() !== ”).map(p => `

${p}

`).join(‘\n’); } // 2. Fallback ensure AMG link is in the very first paragraph if AI missed it if (!htmlContent.includes(‘alazharmemorialgarden.com’)) { const amgLinkHTML = `Al Azhar Memorial Garden – `; // Find the first

and inject it htmlContent = htmlContent.replace(/

/i, `

${amgLinkHTML}`); } parsedData.artikelHTML = htmlContent; setArticleData(parsedData); setTimeout(() => { resultRef.current?.scrollIntoView({ behavior: ‘smooth’, block: ‘start’ }); }, 500); } } catch (err) { setError(“Gagal membuat artikel lengkap. Silakan coba lagi.”); console.error(err); } finally { setIsLoadingArticle(false); } }; // — ACTIONS (EXPORT) — const handleExportGoogleDoc = () => { if(!articleData) return; const htmlString = `

${articleData.judulArtikel.utama}

Kategori: ${selectedCategory.label} | Dibuat pada: ${dateGenerate}

Strategi Keyword

  • Focus Keyword Utama: ${articleData.strategiKeyword.utama}
  • Focus Keyword Tambahan: ${articleData.strategiKeyword.tambahan.join(‘, ‘)}

Judul Artikel

  • Judul Utama: ${articleData.judulArtikel.utama}
  • Alternatif 1: ${articleData.judulArtikel.alternatif1}
  • Alternatif 2: ${articleData.judulArtikel.alternatif2}

Artikel

${articleData.artikelHTML}

Snippet (Meta Data)

Meta Title: ${articleData.snippet.metaTitle}

Meta Description: ${articleData.snippet.metaDescription}

URL Suggestion: ${articleData.snippet.url}

PROMPT COVER AI

${articleData.promptAI}

`; // Create hidden div for copying rich text format const tempDiv = document.createElement(“div”); tempDiv.innerHTML = htmlString; tempDiv.style.position = “absolute”; tempDiv.style.left = “-9999px”; document.body.appendChild(tempDiv); // Select the content const range = document.createRange(); range.selectNodeContents(tempDiv); const selection = window.getSelection(); selection.removeAllRanges(); selection.addRange(range); try { // Execute Copy Command document.execCommand(‘copy’); // Show Success Toast setShowToast(true); setTimeout(() => setShowToast(false), 5000); // Open New Google Doc Tab window.open(‘https://docs.google.com/document/create’, ‘_blank’); } catch (err) { console.error(‘Gagal menyalin text: ‘, err); } // Cleanup selection.removeAllRanges(); document.body.removeChild(tempDiv); }; const handleExportWord = () => { if(!articleData) return; const htmlString = ` ${articleData.judulArtikel.utama}

${articleData.judulArtikel.utama}

Kategori: ${selectedCategory.label} | Dibuat pada: ${dateGenerate}

Strategi Keyword

  • Focus Keyword Utama: ${articleData.strategiKeyword.utama}
  • Focus Keyword Tambahan: ${articleData.strategiKeyword.tambahan.join(‘, ‘)}

Judul Artikel

  • Judul Utama: ${articleData.judulArtikel.utama}
  • Alternatif 1: ${articleData.judulArtikel.alternatif1}
  • Alternatif 2: ${articleData.judulArtikel.alternatif2}

Artikel

${articleData.artikelHTML}

Snippet (Meta Data)

Meta Title: ${articleData.snippet.metaTitle}

Meta Description: ${articleData.snippet.metaDescription}

URL Suggestion: ${articleData.snippet.url}

PROMPT COVER AI

${articleData.promptAI}

`; const source = ‘data:application/vnd.ms-word;charset=utf-8,’ + encodeURIComponent(htmlString); const fileDownload = document.createElement(“a”); document.body.appendChild(fileDownload); fileDownload.href = source; fileDownload.download = `AMG_${articleData.judulArtikel.utama.replace(/[^a-z0-9]/gi, ‘_’).substring(0, 30)}.doc`; fileDownload.click(); document.body.removeChild(fileDownload); }; return (
{/* — HEADER — */}
{/* Logo Injection */}
Al Azhar Memorial Garden { e.target.onerror = null; e.target.style.display = ‘none’; e.target.nextSibling.style.display = ‘flex’; // Show fallback “A” box if image is missing locally }} />
A

AMG ContentPro

Marketing & SEO Article Generator

{/* — LEFT SIDEBAR (KEYWORDS) — */}

Ide Keyword

{isLoadingKeywords ? (

Mencari ide keyword AI…

) : (
{recommendedKeywords.map((kw, idx) => (

“{kw.keyword}”

Vol: {kw.volume}/bln

))}
)}
{/* — RIGHT CONTENT (GENERATOR & OUTPUT) — */}
{/* STEP 1: CATEGORY */}

1 Pilih Kategori Artikel

{CATEGORIES.map((cat) => { const Icon = cat.icon; const isSelected = selectedCategory?.id === cat.id; return ( ) })}
{selectedCategory?.reqInput && (