์ ์๊ถ ์์ ํ๊ฒ ์งํค๊ธฐ, ๊ด๊ณ ์์ต ํ์๊น์ง ํ ๋ฒ์ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ
๋ธ๋ก๊ทธ ์ ์๊ถ ๋ณดํธ์ ๊ด๊ณ ์์ต ํ์ ๋ฐฉ๋ฒ ์ด์ ๋ฆฌ. ๋ณต์ฌ ๋ฐฉ์ง, ์ถ์ฒ ์๋ ์ฝ์ , ์ ๋์ผ์ค์นด์นด์ค ๊ด๊ณ ์๋ด๋ฌธ์ผ๋ก ์ฝํ ์ธ ์ ๋ขฐ๋๋ฅผ ๋์ด๊ณ SEO๋ ์ต์ ํํ์ธ์.
๋ธ๋ก๊ทธ ๊ธ์ ํ์ง์ ๋์ด๋ ํต์ฌ์ ํฌ๋ช ์ฑ๊ณผ ์ ๋ขฐ๋ ์ ๋๋ค. ํนํ ๊ด๊ณ ๊ฐ ํฌํจ๋ ์ฝํ ์ธ ์ ๊ฒฝ์ฐ ์ด๋ ๋์ฑ ์ค์ํฉ๋๋ค. ๋ธ๋ก๊ทธ๋ฅผ ์ด์ํ๋ค ๋ณด๋ฉด,๋ด ๊ธ์ ์ ์๊ถ์ด ์๋ค๋ ๊ฑธ ํ์คํ ์๋ ค์ผ ํ ๋๊ฐ ์์ต๋๋ค. ํนํ, ์ฝํ ์ธ ์์ ๊ด๊ณ ๊ฐ ํฌํจ๋์ด ์๋ค๋ฉด, ์ด์์์ ๊ด๊ณ ์ฃผ ์ฌ์ด์ ๊ด๊ณ๋ ๋ถ๋ช ํ๊ฒ ํ์ํ๋ ๊ฒ ์ข์ฃ . ์ด๋ ๊ฒ ํ๋ฉด ๋ด ์ฝํ ์ธ ์ ๋ํ ๊ถ๋ฆฌ๋ฅผ ๋ณดํธํ ์ ์์ ๋ฟ ์๋๋ผ, ๋ฌด๋จ ๋์ฉ์ด๋ ๊ธ ํผ๊ฐ๊ธฐ๋ฅผ ๋ง๋ ๋ฐ์๋ ๋์์ด ๋ฉ๋๋ค.
๊ด๊ณ ์ ๊ด๋ จ๋ ๊ฒฝ์ ์ ์ดํด๊ด๊ณ๋ฅผ ํ์ํ๋ ๊ฑด ๋จ์ํ ์ ํ์ด ์๋๋ผ ๊ณต์ ๊ฑฐ๋์์ํ ์ฌ์ฌ์ง์นจ์์ ๊ถ์ฅํ๋ ์ฌํญ์ด๊ธฐ๋ ํฉ๋๋ค.
์๋ฅผ ๋ค์ด ๋ด๋๋ด์ฐ์ด๋ ์์ต์ด ๋ฐ์ํ ์๋ ์์ ๊ฐ์ ์ ๋งคํ ํํ์ ์ฐ๋ ๊ฑด ์ฌ์ค ์ข์ ๋ฐฉ๋ฒ์ด ์๋์์. ์คํ๋ ค ๋ช
ํํ๊ฒ ์ด ๊ด๊ณ ๋ฅผ ํตํด ์์ต์ด ๋ฐ์ํฉ๋๋ค ์ฒ๋ผ ์ ์ด์ผ ํ๋ต๋๋ค.
๋ธ๋ก๊ทธ ์ด์ ํ์: ์ฝํ ์ธ ์ ์๊ถ ํ์์ ๊ด๊ณ ๊ฒฝ์ ์ ์ดํด๊ด๊ณ ํ์
๊ทธ๋ ๋ค๋ฉด ์ ์ด๋ฐ ๊ท์ ์ค์์ ์ ์๊ถ ํ๊ธฐ๊ฐ ์ฝํ
์ธ ํ์ง์ ๋์ด๋ ๊ฑธ๊น์?
๊ฐ๋จํฉ๋๋ค. ๊ท์ ์ ์งํค์ง ์์ผ๋ฉด ๋ถํ์ํ ์ ์ฌ๋ฅผ ๋ฐ์ ์ ์๊ณ , ๋ ์์ฆ ์ฌ์ฉ์๋ ๊ด๊ณ ์ ์ฝํ
์ธ ์ ๊ด๊ณ๊ฐ ๋ช
ํํ๊ฒ ๋๋ฌ๋๋ค๊ณ ํด์ ๊ตณ์ด ๋ ๋์ง ์๊ฑฐ๋ ์. ์คํ๋ ค ํฌ๋ช
ํ๊ฒ ์ด์ํ๋ ๋ธ๋ก๊ทธ๋ผ๋ ์ธ์์ ์ฃผ๋ฉด์ ์ ๋ขฐ๋๋ฅผ ๋์ฌ์ค๋๋ค. ์ ๋ขฐ๊ฐ ๋์์ง๋ฉด ๊ด๊ณ ํด๋ฆญ๋ฅ ๊ฐ์ ์์น์๋ ๊ธ์ ์ ์ธ ๋ณํ๊ฐ ์๊น๋๋ค.
๋ช
ํํ ๊ฒฝ์ ์ ์ดํด๊ด๊ณ ํ์๋ ์ฌ์ฉ์์ ํด๋ฆญ ์๊ตฌ๋ฅผ ์๊ทนํ๊ณ , ๊ทธ๊ฑด ๊ณง ์ข์ ์ฝํ
์ธ ์ ๋ํ ๋ณด์์ผ๋ก ์ด์ด์ง๋๋ค. ์์ ํฐ์คํ ๋ฆฌ์ ์์๋ ์์ํ๊ธฐ ๊ธฐ๋ฅ์ฒ๋ผ, ๋
์๊ฐ ์์ฐ์ค๋ฝ๊ฒ ์ฐธ์ฌํ๊ณ ์ถ์ด์ง๋ ํจ๊ณผ๋ฅผ ๋ง๋ค ์ ์๋ ๊ฑฐ์ฃ .
๊ธ ๋ด์ฉ์ ์ ์๊ถ ํ์ํ๊ธฐ
๋ธ๋ก๊ทธ๋ฅผ ์ด์ํ๋ค ๋ณด๋ฉด, ๋ด ์ฝํ
์ธ ๊ฐ ๋ค๋ฅธ ๊ณณ์ ๋ฌด๋จ์ผ๋ก ๋ณต์ฌ๋๋ ์ผ์ด ์ข
์ข
์์ต๋๋ค.
์ด๋ฅผ ๋ฐฉ์งํ๊ธฐ ์ํด ์ ์๊ถ ํ์ ํ๋ฌ๊ทธ์ธ์ ํ์ฉํ๋ ๋ถ๋ค์ด ๋ง์ต๋๋ค.
์ด ๊ธฐ๋ฅ์ ๋๊ตฐ๊ฐ ๋ด ๊ธ์ ๋ณต์ฌํ ๋, ์๋์ผ๋ก ์ถ์ฒ๋ ์ ์๊ถ ๋ฌธ๊ตฌ๋ฅผ ๋ถ์ฌ์ฃผ๋ ๋ฐฉ์์ธ๋ฐ,
๋จ์ ๋ ์์ต๋๋ค.
์ผ๋ฐ์ ์ธ ์ฐํด๋ฆญ ๋ฐฉ์ง๋ ๋ณต์ฌ ๋ฐฉ์ง ํ๋ฌ๊ทธ์ธ์ ์ฌ๋์ด ์ง์ ๊ธ์ ๋ณต์ฌํ ๋๋ ํจ๊ณผ์ ์ผ ์ ์์ง๋ง,
์๋ํ๋ ํฌ๋กค๋ฌ(๋ด), ํ์ฅ ํ๋ก๊ทธ๋จ, ๊ฐ๋ฐ์ ๋๊ตฌ๋ฅผ ์ด์ฉํ๋ฉด ์ด ๊ธฐ๋ฅ์ ์ฝ๊ฒ ์ฐํํ ์ ์์ต๋๋ค.
๊ฒฐ๊ตญ ์ด๋ฐ ๋ฐฉ์๋ง์ผ๋ก๋ ์ฝํ
์ธ ๋์ฉ ๋ฐฉ์ง๊ฐ ์๋ฒฝํ์ง ์์ฃ .
๊ทธ๋์ ๋ ๊ฐ๋ ฅํ ๋ฐฉ๋ฒ์ด ํ์ํฉ๋๋ค.
์๋ ์์ ์ฝ๋๋ ๋ธ๋ก๊ทธ๋ ์น์ฌ์ดํธ์ ์ ์ฉํ๋ฉด,

- ๋ณธ๋ฌธ ํน์ ์์น์ ์ถ์ฒ ์๋ด๋ฌธ์ ์๋์ผ๋ก ์ฝ์
- ๋ณต์ฌ ์ ์๋์ผ๋ก ์ถ์ฒ ์ถ๊ฐ
- SEO์ ๋ถํ์ํ ์ํฅ์ ์ฃผ์ง ์๋๋ก data-nosnippet ๋ฑ ์์ฑ ํ์ฉ
์ด ๊ฐ๋ฅํ๋๋ก ๊ตฌ์ฑ๋์ด ์์ต๋๋ค.
์ฝ๋ ์ค๋ช
์ด ์ฝ๋๋ ๋ณธ๋ฌธ 3๋ฒ์งธ p ํ๊ทธ ๋ค์ ์ฝํ ์ธ ์ถ์ฒ ์๋ด๋ฌธ์ ์ฝ์ ํ๊ณ , ๋ง์ง๋ง p ํ๊ทธ ๋ค์๋ ๊ธ ์์ ์ผ์ ์๋์ผ๋ก ํ์ํฉ๋๋ค. ๋ํ, ์ฌ์ฉ์๊ฐ ๊ธ์ ๋ณต์ฌํ๋ฉด ์๋์ผ๋ก ํ์ด์ง ์ฃผ์์ ์ถ์ฒ๋ฅผ ํด๋ฆฝ๋ณด๋์ ํจ๊ป ๋ฃ์ด์ค๋๋ค.
๊ฒ์ ์์ง์ ๋ถํ์ํ๊ฒ ์ธ๋ฑ์ฑ๋์ง ์๋๋ก aside role="note" data-nosnippet ์์ฑ์ ์ฌ์ฉํด, SEO์ ๋ถ์ ์ ์ธ ์ํฅ์ ์ต์ํํ์ต๋๋ค.
script
document.addEventListener("DOMContentLoaded", () = {
const path = window.location.pathname;
if (path === '/' || path.startsWith('/category/')) return;
const h1 = document.querySelector('div.tt_article_useless_p_margin h1');
if (!h1) return;
const h1Text = h1.textContent.trim();
const newText = 'โ ' + h1Text + ' -[์ถ์ฒ์๋ด:์ผ์ํ๋ธ์์ ์ ๊ณตํฉ๋๋ค]';
const pTags = Array.from(document.querySelectorAll('div.tt_article_useless_p_margin p'));
// p ํ๊ทธ 3๋ฒ์งธ ๋ค์ ์๋ด๋ฌธ ์ถ๊ฐ
if (pTags.length = 3) {
const newAside = document.createElement('aside');
newAside.className = 'source-note';
newAside.textContent = newText;
newAside.style.color = '#FFFF66';
newAside.setAttribute('role', 'note');
newAside.setAttribute('data-nosnippet', 'true');
pTags[2].insertAdjacentElement('afterend', newAside);
}
// ๋ง์ง๋ง p ๋ค์ ๊ธ ์์ ์ผ ๊ธฐ๋ฐ ์๋ด๋ฌธ ์ถ๊ฐ
if (pTags.length = 1) {
const lastP = pTags[pTags.length - 1];
const metaModified = document.querySelector('head meta[property="article:modified_time"]');
if (metaModified) {
const modifiedDate = new Date(metaModified.getAttribute('content'));
const dateText = `${modifiedDate.getFullYear()}.${modifiedDate.getMonth() + 1}.${modifiedDate.getDate()} ์ผ์ํ๋ธ`;
const dateP = document.createElement('p');
dateP.className = 'article-modified-date';
dateP.textContent = dateText;
lastP.insertAdjacentElement('afterend', dateP);
}
}
// ๋ณต์ฌ ์ ์๋ ์ถ์ฒ ์ถ๊ฐ
document.addEventListener('copy', function(e) {
const selection = window.getSelection().toString();
const pageUrl = window.location.href;
const sourceText = selection + "\n\n์ถ์ฒ: " + pageUrl + " (์ผ์ํ๋ธ)";
e.clipboardData.setData('text/plain', sourceText);
e.preventDefault();
});
});
/script
์ฝ๋์ ์ ์ฉ๋ SEO ๊ด๋ จ ์์ฑ ์ค๋ช
1. aside ํ๊ทธ
- ์๋ฏธ: ๋ณธ๋ฌธ๊ณผ ์ง์ ์ ์ธ ์ฐ๊ด์ ์์ง๋ง ์ฐธ๊ณ ํ ์ ์๋ ๋ถ๊ฐ ์ฝํ ์ธ ๋ฅผ ๋ด์ ๋ ์ฌ์ฉ.
- SEO ์ํฅ: ๊ฒ์์์ง์ aside ๋ด๋ถ์ ํ ์คํธ๋ฅผ ๋ณธ๋ฌธ ํต์ฌ ์ฝํ ์ธ ๋ก ๊ฐ์ฃผํ์ง ์์.
- ํ์ฉ ์ด์ : ์ถ์ฒ ์๋ด๋ฌธ, ์ ์๊ถ ์๋ด๋ฌธ์ฒ๋ผ ๊ฒ์ ๋ ธ์ถ์ ๊ตณ์ด ํฌํจ๋ ํ์ ์๋ ๋ฌธ๊ตฌ๋ฅผ ๋ฃ์ ๋ ์ ์ฉ
const newAside = document.createElement('aside');
newAside.textContent = newText;
newAside.style.color = '#FFFF66';
pTags[6].insertAdjacentElement('afterend', newAside);
2. role="note" ์์ฑ
- ์๋ฏธ: ํด๋น ์์๊ฐ ์๋ด/๋ถ๊ฐ ์ ๋ณด์์ ๋ช ์.
- ์ ๊ทผ์ฑ(A11y): ํ๋ฉด ์ฝ๊ธฐ ํ๋ก๊ทธ๋จ(์คํฌ๋ฆฐ ๋ฆฌ๋) ๋ฑ์์ ์ฐธ๊ณ ์ ๋ณด๋ก ์ธ์.
- SEO ์ํฅ: ๊ฒ์์์ง์๊ฒ๋ ๋ณธ๋ฌธ๊ณผ ๋ณ๋์ ์ฐธ๊ณ ์ ๋ณด๋ผ๋ ์๋ฏธ๋ฅผ ์ ๋ฌ.
const newP = document.createElement('p');
newP.textContent = newText;
newP.style.color = '#FFFF66';
newP.setAttribute('role', 'note'); // ๋ถ๊ฐ ์ฝํ
์ธ ํ์
pTags[6].insertAdjacentElement('afterend', newP);
3. data-nosnippet ์์ฑ
- ์๋ฏธ: ๊ตฌ๊ธ ๊ฒ์์์ ํด๋น ์์์ ๋ด์ฉ์ ๊ฒ์๊ฒฐ๊ณผ ์ค๋ํซ(๋ฏธ๋ฆฌ๋ณด๊ธฐ)์ ํฌํจํ์ง ์๋๋ก ์ง์ .
- ํจ๊ณผ: ๋ณธ๋ฌธ์๋ ํ์๋์ง๋ง, ๊ฒ์๊ฒฐ๊ณผ ์์ฝ์๋ ๋ ธ์ถ๋์ง ์์.
- ํ์ฉ ์ด์ : ๋ถํ์ํ ์๋ด๋ฌธ์ด ๊ฒ์๊ฒฐ๊ณผ ์์ฝ์ ๋ค์ด๊ฐ์ง ์๊ฒ ๋ฐฉ์ง.
newP.setAttribute('data-nosnippet', 'true'); // ๊ฒ์ ์ค๋ํซ ์ ์ธ
๊ด๊ณ ์๋ด๋ฌธ ์๋ ์์ฑ ์ฝ๋ ์ ๋ฆฌ
- aside ์ด๊ฑด ๋ณธ๋ฌธ ํต์ฌ์ด ์๋์ผ.
- role="note" ์ด๊ฑด ์ฐธ๊ณ /์๋ด๋ฌธ์ด์ผ.
- data-nosnippet ๊ฒ์๊ฒฐ๊ณผ ์์ฝ์๋ ๋นผ์ค.
์ด ์ธ ๊ฐ์ง๋ฅผ ์กฐํฉํ๋ฉด SEO ๋ฐฉํด ์์ด, ์ฌ์ฉ์์๊ฒ๋ง ํ์ํ ์๋ด๋ฌธ์ ๋ณด์ฌ์ค ์ ์์ต๋๋ค.
๊ด๊ณ ์ ๊ฒฝ์ ์ ์ดํด๊ด๊ณ ํ์ํ๊ธฐ
์๋๋ ์ ๋์ผ์ค(AdSense)์ ์ ๋ํ(AdFit) ๊ด๊ณ ์๋์ "์ด ๊ด๊ณ ๋ ๊ด๊ณ ํ๋์ ์ผํ์ผ๋ก ์ด์ ๋ฐ๋ฅธ ์ผ์ ์ก์ ์์๋ฃ๋ฅผ ์ ๊ณต๋ฐ์ต๋๋ค." ๋ผ๋ ์๋ด๋ฌธ์ ์๋์ผ๋ก ์ฝ์ ํ๋ JavaScript ์ฝ๋์ ๋๋ค.
๋ธ๋ก๊ทธ์์ ์ ๋์ผ์ค ๊ด๊ณ ๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ, ๊ด๊ณ ๊ฐ ์ ์์ ์ผ๋ก ํ์๋๋ฉด ๊ด๊ณ ํ๋จ์ ์๋ด๋ฌธ์ ์ถ๊ฐํด ๋ฐฉ๋ฌธ์์๊ฒ ๊ฒฝ์ ์ ์ดํด๊ด๊ณ๋ฅผ ๋ช ํํ ๋ณด์ฌ์ค ์ ์์ต๋๋ค.
1. ์ ๋์ผ์ค ๊ด๊ณ ๊ฒฝ์ ์ ์ดํด๊ด๊ณ ํ์
์ ๋์ผ์ค ๊ด๊ณ ๊ฐ ์ธํ๋(data-ad-status="unfilled") ์ํ์ด๋ฉด ์๋ด๋ฌธ์ ํ์ํ์ง ์๊ณ ๊ด๊ณ ๊ฐ ๋ ธ์ถ๋ ๊ฒฝ์ฐ๋ง ๊ด๊ณ ์ดํด๊ด๊ณ๋ฅผ ํ์ํด ์ค๋๋ค.
script
document.addEventListener("DOMContentLoaded", () = {
setTimeout(() = {
const noticeText = "โป ์ด ๊ด๊ณ ๋ฅผ ํตํด ์ด์ ๋ฐ๋ฅธ ์ผ์ ์ก์ ์์๋ฃ๋ฅผ ์ ๊ณต๋ฐ์ต๋๋ค.";
const insertNoticeBelow = (ad) = {
if (!ad.nextElementSibling || !ad.nextElementSibling.classList.contains('ad-desc-wrapper')) {
const wrapper = document.createElement('aside');
wrapper.className = 'ad-desc-wrapper';
wrapper.style.width = '100%';
wrapper.style.marginTop = '0.3rem';
wrapper.style.textAlign = 'center';
wrapper.setAttribute('role', 'note');
wrapper.setAttribute('data-nosnippet', 'true');
const notice = document.createElement('p');
notice.className = 'ad-desc';
notice.textContent = noticeText;
notice.style.color = '#fff';
notice.style.fontSize = '0.9rem';
notice.style.lineHeight = '1.3';
notice.style.margin = 0;
wrapper.appendChild(notice);
ad.insertAdjacentElement('afterend', wrapper);
}
};
document.querySelectorAll('ins.adsbygoogle').forEach(ad = {
const adStatus = ad.getAttribute('data-ad-status');
const adClient = ad.getAttribute('data-ad-client');
if (adClient === 'ca-pub-9527582522912841') return; // ํน์ ํด๋ผ์ด์ธํธ ์๋ด๋ฌธ ์๋ต
if (adStatus !== 'unfilled' && ad.offsetHeight 0) {
insertNoticeBelow(ad);
}
});
}, 2000);
});
/script
์ฝ๋ ์ค๋ช
- data-ad-status๋ฅผ ์ฒดํฌํด ๊ด๊ณ ๊ฐ ์ธํ๋์ธ์ง ํ์ธ
- ๊ด๊ณ ์์ ๋์ด(offsetHeight)๊ฐ 0๋ณด๋ค ํด ๋๋ง ์๋ด๋ฌธ ์์ฑ
- ์๋ด๋ฌธ์ p ํ๊ทธ๋ก ์์ฑ, ํด๋์ค ad-desc ๋ถ์ฌ
- role="note"์ data-nosnippet="true" ์์ฑ์ผ๋ก SEO์ ์ ๊ทผ์ฑ ๊ณ ๋ ค
- ๋๋ ์ด 2์ด(setTimeout)๋ฅผ ์ค ๊ด๊ณ ๋ ๋๋ง ์๋ฃ ํ ์คํ
2. ์นด์นด์ค ๊ด๊ณ ์๋ ์๋ด๋ฌธ ํ์
์นด์นด์ค ๊ด๊ณ ์ ๊ฒฝ์ฐ, ๊ด๊ณ ๊ฐ ์ฝ์ ๋๋ฉด ๋์ด๊ฐ ์กด์ฌํ ๋๋ง ์๋ด๋ฌธ์ ํ์ํฉ๋๋ค. ์นด์นด์ค ๊ด๊ณ ๋ ์ ๋์ผ์ค์ ๋ฌ๋ฆฌ ์ธํ๋ ์ํ๊ฐ ๋ช ์๋์ง ์์ผ๋ฏ๋ก, ๊ด๊ณ ์์ญ์ ๋์ด(offsetHeight)๋ฅผ ๊ธฐ์ค์ผ๋ก ์๋ด๋ฌธ ํ์ ์ฌ๋ถ๋ฅผ ํ๋จํฉ๋๋ค.
script
document.addEventListener("DOMContentLoaded", () = {
setTimeout(() = {
const noticeText = "โป ์ด ๊ด๊ณ ๋ฅผ ํตํด ์ด์ ๋ฐ๋ฅธ ์ผ์ ์ก์ ์์๋ฃ๋ฅผ ์ ๊ณต๋ฐ์ต๋๋ค.";
const insertNoticeBelow = (ad) = {
if (!ad.nextElementSibling || !ad.nextElementSibling.classList.contains('ad-desc-wrapper')) {
const wrapper = document.createElement('aside');
wrapper.className = 'ad-desc-wrapper';
wrapper.style.width = '100%';
wrapper.style.marginTop = '0.3rem';
wrapper.style.textAlign = 'center';
wrapper.setAttribute('role', 'note');
wrapper.setAttribute('data-nosnippet', 'true');
const notice = document.createElement('p');
notice.className = 'ad-desc';
notice.textContent = noticeText;
notice.style.color = '#fff';
notice.style.fontSize = '0.9rem';
notice.style.lineHeight = '1.3';
notice.style.margin = 0;
wrapper.appendChild(notice);
ad.insertAdjacentElement('afterend', wrapper);
}
};
document.querySelectorAll('ins.kakao_ad_area').forEach(ad = {
if (ad.offsetHeight 0) {
insertNoticeBelow(ad);
}
});
}, 2000);
});
/script
์ฝ๋ ์ค๋ช
- ๊ด๊ณ ์์ญ ๋์ด๊ฐ 0๋ณด๋ค ํด ๋๋ง ์๋ด๋ฌธ ์์ฑ
- ์๋ด๋ฌธ ์ญ์ p ํ๊ทธ๋ก ์์ฑ, ํด๋์ค ad-desc ๋ถ์ฌ
- ๋คํฌ ๋ชจ๋ ๋์ ๊ธ์์ ํฐ์ ์ ์ฉ
- SEO ๋ฐ ์ ๊ทผ์ฑ ๊ณ ๋ ค๋ฅผ ์ํด role="note"์ data-nosnippet="true" ์์ฑ ์ ์ง
๊ด๊ณ ๊ฒฝ์ ์ ์ดํด ๊ด๊ณ ํ์ ์ฝ๋ ๋์ ๋ฐฉ์
๊ณตํต ์๋ด๋ฌธ ์์ฑ
- createAdNotice() ํจ์๋ก ์๋ด๋ฌธ์ ํ ๋ฒ์ ์ ์.
- ์คํ์ผ๊ณผ ๋ฌธ๊ตฌ๋ฅผ ์ง์ ํ์ฌ, ๊ด๊ณ ์๋์ ์์ฐ์ค๋ฝ๊ฒ ํ์.
์ ๋์ผ์ค ๊ด๊ณ ํ์ง
- ins class="adsbygoogle" ์์ ์ฐพ๊ธฐ.
- ๊ด๊ณ ๋ฐ๋ก ๋ค(afterend)์ ์๋ด๋ฌธ ์ฝ์ .
์ ๋ํ ๊ด๊ณ ํ์ง
- div[data-ad-unit] ๋๋ iframe ๊ฒฝ๋ก์ "adfit"์ด ํฌํจ๋ ์์ ์ฐพ๊ธฐ.
- ๋์ผํ๊ฒ ๊ด๊ณ ๋ฐ๋ก ๋ค์ ์๋ด๋ฌธ ์ฝ์ .
3. ๋ค์ด๋ฒ ๊ด๊ณ ์๋ด๋ฌธ ์๋ ์ฝ์ ์คํฌ๋ฆฝํธ
์ด ์คํฌ๋ฆฝํธ๋ ํฐ์คํ ๋ฆฌ ๋ธ๋ก๊ทธ์์ ์๋ ๊ฒ์ฌ๋๋ ๋ค์ด๋ฒ ๊ด๊ณ (NaverAd) ์๋์, ์ด ๊ด๊ณ ๋ ๋ธ๋ก๊ทธ ์ด์์์ ์ง์ ์ ์ธ ๊ด๋ จ์ด ์๋ค๋ ์๋ด๋ฌธ์ ์๋์ผ๋ก ์ถ๊ฐํ๋ ์ญํ ์ ํฉ๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด ๋ฐฉ๋ฌธ์๊ฐ ๊ด๊ณ ์ ์ฝํ ์ธ ๋ฅผ ํผ๋ํ์ง ์๊ฒ ๋๊ณ , ๊ด๊ณ ์ ๋ํ ๊ฒฝ์ ์ ์ดํด๊ด๊ณ ํ์ ์๋ฌด(๊ณต์ ๊ฑฐ๋์์ํ ๊ฐ์ด๋๋ผ์ธ)๋ ์์ฐ์ค๋ฝ๊ฒ ์ถฉ์กฑํ ์ ์์ต๋๋ค.
์ฝ๋ ์์
script
document.addEventListener("DOMContentLoaded", function () {
const url = window.location.href;
if (
url === window.location.origin + "/" ||
url.includes("/category/")
) {
return;
}
const naverAd = document.querySelector('div[data-tistory-react-app="NaverAd"]');
if (naverAd) {
const notice = document.createElement("p");
notice.className = "ad-desc";
notice.style.minHeight = "40px";
notice.style.marginTop = "0.5rem";
notice.style.fontSize = "0.9rem";
notice.style.lineHeight = "1.3";
notice.style.boxSizing = "border-box";
notice.style.width = "100%";
notice.textContent = "โป ์ด ๊ด๊ณ ๋ ํฐ์คํ ๋ฆฌ์์ ์๋์ผ๋ก ๊ฒ์ฌ๋๋ ๊ฒ์ผ๋ก, ๋ธ๋ก๊ทธ ์ด์์์ ์ง์ ์ ์ธ ๊ด๋ จ์ด ์์ต๋๋ค.";
naverAd.insertAdjacentElement("afterend", notice);
}
});
/script
- ๋ฒ๊ท ์ค์: ๊ด๊ณ ์ ์ฝํ ์ธ ์ ์ดํด๊ด๊ณ๋ฅผ ๋ช ํํ ํ์ฌ ๊ณต์ ๊ฑฐ๋์์ํ ๊ฐ์ด๋๋ผ์ธ ์ถฉ์กฑ.
- ์ ๋ขฐ๋ ํฅ์: ๋ฐฉ๋ฌธ์๊ฐ ์ด ๊ด๊ณ ๋ ์ด์์๊ฐ ์ง์ ๋ฐฐ์นํ ๊ฒ์ด ์๋์ ์๊ฒ ๋์ด ์ฝํ ์ธ ์ ๋ขฐ๋ ์์น.
- ํ์ด์ง ์ฒด๋ฅ์๊ฐ ์ ์ง: ๊ด๊ณ ์คํด๋ก ์ธํ ์ดํ ๋ฐฉ์ง.
- ์๋ํ: ๊ธ๋ง๋ค ์๋์ผ๋ก ์๋ด๋ฌธ์ ๋ฃ์ง ์์๋ ๋ชจ๋ ๊ด๊ณ ์ ์๋ ์ ์ฉ.
์ด์ ๊ฐ์ ๋ฐฉ๋ฒ๋ค์ ํตํด ๋ธ๋ก๊ทธ ๊ธ์ ๋ด์ฉ์ ๋์ฑ ํ์ฑํ๊ณ ์ ๋ขฐ์ฑ ์๊ฒ ๋ง๋ค๋ฉด์ ๋์์ ๊ฒ์ ์์ง ์ต์ ํ๋ ํจ๊ณผ์ ์ผ๋ก ๊ด๋ฆฌํ ์ ์์ต๋๋ค.
๋ธ๋ก๊ทธ์์ ๋ด ๊ธ์ ์ ์๊ถ์ ์์ ํ๊ฒ ์งํค๋ ๋ฐฉ๋ฒ์ ๋ฌด์์ธ๊ฐ์?
๋ธ๋ก๊ทธ ๊ธ์ ์ ์๊ถ ํ์๋ฅผ ํ๊ณ , ๋ณต์ฌ ์ ์๋์ผ๋ก ์ถ์ฒ๋ฅผ ์ฝ์ ํ๋๋ก ์ค์ ํ๋ฉด ๊ธ ๋์ฉ์ ๋ฐฉ์งํ ์ ์์ต๋๋ค. ๋ํ aside, role="note", data-nosnippet ์์ฑ์ ํ์ฉํ๋ฉด SEO์ ์ํฅ์ ์ฃผ์ง ์์ผ๋ฉด์ ๋ ์์๊ฒ๋ง ์๋ด๋ฌธ์ ๋ณด์ฌ์ค ์ ์์ต๋๋ค.
๊ด๊ณ ๊ฐ ํฌํจ๋ ๋ธ๋ก๊ทธ ๊ธ์์ ๊ฒฝ์ ์ ์ดํด๊ด๊ณ๋ฅผ ํ์ํด์ผ ํ๋ ์ด์ ๋ ๋ฌด์์ธ๊ฐ์?
๊ณต์ ๊ฑฐ๋์์ํ ์ง์นจ์ ๋ฐ๋ผ ๊ด๊ณ ์ ์ฝํ ์ธ ์ ๊ด๊ณ๋ฅผ ๋ช ํํ ํ์ํ๋ฉด, ๋ฐฉ๋ฌธ์๊ฐ ๊ด๊ณ ๋ฅผ ์ฌ๋ฐ๋ฅด๊ฒ ์ดํดํ๊ณ ๋ธ๋ก๊ทธ์ ์ ๋ขฐ๋๊ฐ ๋์์ง๋๋ค. ์ด๋ ๋ถํ์ํ ์ ์ฌ๋ฅผ ํผํ๊ณ ๊ด๊ณ ํด๋ฆญ๋ฅ ๊ณผ ์ฌ์ฉ์ ์ฐธ์ฌ๋ฅผ ์์ฐ์ค๋ฝ๊ฒ ๋์ด๋ ํจ๊ณผ๊ฐ ์์ต๋๋ค.
์ ๋์ผ์ค์ ์นด์นด์ค ๊ด๊ณ ์๋ ์๋ด๋ฌธ์ ์๋์ผ๋ก ํ์ํ๋ ๋ฐฉ๋ฒ์ ๋ฌด์์ธ๊ฐ์?
๊ด๊ณ ๊ฐ ์ ์์ ์ผ๋ก ๋ ธ์ถ๋ ๋๋ง p ํ๊ทธ๋ก ์๋ด๋ฌธ์ ์์ฑํ๊ณ , ๋คํฌ ๋ชจ๋์ ๋ง๊ฒ ๊ธ์์์ ํฐ์์ผ๋ก ์ค์ ํฉ๋๋ค. role="note"์ data-nosnippet="true" ์์ฑ์ ์ฌ์ฉํด SEO์ ์ ๊ทผ์ฑ์ ๊ณ ๋ คํ๋ฉฐ, setTimeout์ผ๋ก ๊ด๊ณ ๋ ๋๋ง ํ 2์ด ๋๋ ์ด๋ฅผ ์ฃผ์ด ์๋์ผ๋ก ์ฝ์ ๋๋๋ก ๊ตฌํํฉ๋๋ค.