Open graph๋ ์์
๋คํธ์ํฌ์์ ์์ํ ๊ฐ๋
์ด๋ฉฐ ์ธํฐ๋ท ํ๋กํ ์ฝ์ ํ ์ข
๋ฅ๋ก์จ 2010๋
์ ํ์ด์ค๋ถ์์ ๋ฐํํ๋ค.
open graph์ ๋ชฉ์ ์ ์นํ์ด์ง์ ์ ๋ณด๋ฅผ ๊ฐ์ง๊ณ ์๋ meta data๋ฅผ ํ์คํ ํ์ฌ, ํ์ด์ค๋ถ ๋ด์์ ๋งํฌ๋ฅผ ๊ณต์ ํ ์์ ๊ทธ ์นํ์ด์ง๊ฐ ๊ฐ์ง๊ณ ์๋ ์ ๋ณด๋ฅผ ํน์ ํ์์ ํตํด ๋ฏธ๋ฆฌ๋ณด๊ธฐ ํํ๋ก ์ ๊ณตํด์ฃผ๋ ๊ธฐ๋ฅ์ด๋ค. ํน์ ์ ๋ณด๋ฅผ ์นํ์ด์ง์์ ๋ฏธ๋ฆฌ ๊ฐ๋ตํ๊ฒ ์ ๋ฆฌํ์ฌ ์
๋ ฅํด๋๋ฉด ์ผ๊ด๋ ์ ๋ณด๋ฅผ ์ ๋ฌํ ์ ์๋ค๋ ์ฅ์ ์ด ์๋ค. ์ดํ ํธ์ํฐ์ ๋งํฌ๋์ธ์์ ์ด๋ฅผ ํ์ฉํ์ฌ ๋ ๋์ UX๋ฅผ ์ ๊ณตํ๋๋ฐ์ ํ์ฉ๋๊ณ ์๋ค.
While many technologies and schemas exist and could be combined, there isn't a single technology which provides enough information to richly represent any web page within the social graph. The Open Graph protocol builds on these existing technologies and gives developers one thing to implement. Developer simplicity is a key goal of the Open Graph protocol which has informed many of the technical design decisions.
How to use
metadata๋ฅผ <head> ์์ญ์ ์ถ๊ฐํ๋ฉด bot์ด ํด๋น metadata๋ฅผ ์ฝ์ด์ ๋ด์ฉ์ ํ์ํด์ค๋ค. ๋ค์์ ์ฃผ๋ก ์ฐ์ด๊ณ ๋๋๋ก ๋ช
์ํ๊ธฐ๋ฅผ ๊ถ์ฅํ๋ ์์ฑ๋ค์ด๋ค.
og:titleํ์๋ ์ ๋ชฉog:typewebsite์ ์ ํ (์ฐธ์กฐ)og:imageํ์ํimage์ ์ฃผ์og:url์ ๋ฌํ website ์ฃผ์og:descriptionwebsite์ ๋ํ ์ค๋ชog:site_namewebsite์ ์ด๋ฆog:localelocation ์ ๋ณด
์ค์ ์ฝ๋๋ ์๋์ ๊ฐ์ด ์ ๋ ฅํ๋ค.
<html lang="en">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="https://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="https://ia.media-imdb.com/images/rock.jpg" />
...
</head>
...
</html>
Tag type
opengraph์ ๊ฒฝ์ฐ ๋ช๊ฐ ๋ํ์ ์ธ ํ๋ซํผ๋ค์ meta tag๋ฅผ ์ฌ์ฉํ ์ ์๋๋ก ํ๊ณ ์๋ค.
<!-- ์ผ๋ฐ -->
<meta property="og:title" content="...">
<meta property="og:url" content="...">
<meta property="og:type" content="...">
<meta property="og:image" content="...">
<meta property="og:site_name" content="...">
<meta property="og:description" content="...">
<!-- twitter -->
<meta name="twitter:card" content="...">
<meta name="twitter:title" content="...">
<meta name="twitter:description" content="...">
<meta name="twitter:image" content="...">
<!-- mobile -->
<meta property="al:ios:url" content="...">
<meta property="al:ios:app_store_id" content="...">
<meta property="al:ios:app_name" content="...">
<meta property="al:android:url" content="...">
<meta property="al:android:app_name" content="...">
<meta property="al:android:package" content="..."> Optimal size of Opengraph image ?
opengraph์๋ thumbnail image๋ฅผ ๋ฃ์ ์ ์๋ค. ํ์ง๋ง ํ๋ซํผ๋ง๋ค ์ง์ํ๋ image size๊ฐ ๋ค๋ฅธ๋ฐ ๊ณ ์ ๊ฐ์ ๋ฃ์ด์ฃผ์ด์ผ ํ๊ธฐ๋๋ฌธ์ ๋ช๊ฐ์ง ์ ์ ์ฌํญ๋ค์ ๊ณ ๋ คํ๋ฉด ์ข๋ค.
facebook์์ ๊ถ์ฅํ๋ ํฌ๊ธฐ๋1200x630ํฝ์ ์ด๋ฉฐ, ๊ทธ image ํ์ผ์ฉ๋์5MB๋ฅผ ๋์ง์๋๋ก ๊ถ์ฅํ๋ค600ํฝ์ ๋ฏธ๋ง์ image๋opengraph์ ๋ชฉ ์ผ์ชฝ์ ํ์๋๋ค- ์ต์ ํฌ๊ธฐ๋
200x200์ด๋ ํด์๋๊ฐ ์ด์ ๋๋ก ๋ฎ์ ๊ฒ์ ๊ถ์ฅํ์ง ์๋๋ค
Caution
๊ธฐ์กด ํ์ด์ง์ cache๊ฐ ๋จ์์์ ์ ์์ผ๋ฏ๋ก ์ ์ฉํ๋๋ฐ ์๊ฐ์ด ๊ฑธ๋ฆด์ ์๋ค
ํ์ด์ค๋ถ์ cache๋ฅผ reloadํ๋ ๊ธฐ๋ฅ์ ์ ๊ณตํด์ฃผ๊ธฐ๋ ํ๋ค https://developers.facebook.com/tools/debug
Useful tools
- opengraph ๋ฏธ๋ฆฌ๋ณด๊ธฐ https://www.opengraph.xyz/
- localhost์์ ํ์ธ์ ๋์์ฃผ๋ ํฌ๋กฌ ์ต์คํ ์
Localhost Open Graph Debugger
Localhost Open Graph Checker
- https://ogp.me/
- https://iamturns.com/open-graph-image-size
- https://developers.facebook.com/tools/debug/