How Viber select the image to display from HTML page

mojmir.novak picture mojmir.novak · Jan 22, 2016 · Viewed 9.5k times · Source

when I send some URL to someone via Viber the Viber load the URL and displays image representing the HTML page.

How to tell the HTML page what image it should be?

Answer

Dimko  Desu picture Dimko Desu · Jan 31, 2017

You should use Open Graph protocol. You can simply add this snippet to your page <head>:

<meta property="og:type" content="website">
<meta property="og:site_name" content="Название сайта">
<meta property="og:title" content="Заголовок">
<meta property="og:description" content="Описание.">
<meta property="og:url" content="http://example.com/page.html">
<meta property="og:locale" content="ru_RU">
<meta property="og:image" content="http://example.com/img.jpg">
<meta property="og:image:width" content="968">
<meta property="og:image:height" content="504">

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Заголовок">
<meta name="twitter:description" content="Описание.">
<meta name="twitter:image:src" content="http://example.com/img.jpg">
<meta name="twitter:url" content="http://example.com/page.html">
<meta name="twitter:domain" content="example.com">
<meta name="twitter:site" content="@">
<meta name="twitter:creator" content="@...">

Image size should be 968x504px. Read more here

Cheers!