Open Graph

Open Graph is a vocabulary used for the semantic markup of web data. It lets you control the preview that is generated when publishing links on social networks and transmit information to other internet services. For more details, see the official website.

Note

Data with markup is public and any service can extract and use it.

Alert

If you embed micro markup using a plugin, you’ll probably need to modify it. To do this, contact the plugin developer or another professional with development skills.

Markup principles

Data about an object in Open Graph is described by sets of property-value pairs in meta tags. The property must be specified in property and its value must be specified in content.

Note

Properties and values are case-sensitive. Specify them as shown in the examples and the standard.

The standard requires that Open Graph data be located in the head tag. However, to collect content statistics, we recommend placing meta tags in the node where the content is embedded, especially when there are multiple content items on the page. This is necessary for the correct calculation of the full scroll and full read metrics.

How to mark up materials

Mark up the following content elements (mandatory elements are marked with an asterisk):

Type of the described object*

Yandex Metrica only supports article markup. Other types of content will not be included in Yandex Metrica reports even with the correct markup. The type of object is specified in the og:type property.

<meta property="og:type" content="article">

Title*

The headline is shown in Yandex Metrica reports. It is specified in the property og:title.
<meta property="og:title" content="The temperature in Moscow on Wednesday, November 6 broke the record set in 1922.">

Text*

The text is the content of the node that contains the described material. If the markup is in the head tag, the text will be the entire contents of the body tag. Tag symbols are not taken into account. The text defines the number of characters. This is necessary to determine the volume of material and calculate scroll depth and read depth metrics.

Note

You can get complete statistics for the content with text longer than 500 characters.

Author

The author is specified using the article:author property. If there are several authors, list them in different meta tags.

<meta property="article:author" content="John Smith">
<meta property="article:author" content="Dylan Brown">

With this data, you can view statistics for individual authors.

Subject

You can mark up keywords and hashtags as topics. Specify the topics in the article:tag property. If there are multiple topics, list them in different meta tags.

<meta property="article:tag" content="Heat">
<meta property="article:tag" content="Moscow">

Dates of publication and revision

Publication dates and changes are specified in the article:published_time and article:modified_time properties. Dates are written in ISO 8601 format.

<meta property="article:modified_time" content="2018-12-11T08:56:49Z">
<meta property="article:published_time" content="2018-11-06T09:26:10+04:00">

Category

A heading is a section of a website dedicated to a specific topic. To specify a material category, use the property article:section.

<meta property="article:section" content="Weather">

Content URL

The content URL must be contained in the property og:url.

<meta property="og:url" content="https://www.example-news.com/life/weather/moscow"/>

Otherwise, the value will be taken from the canonical link:

<link rel="canonical" href="https://www.example-news.com/life/weather/moscow">

If the markup is correct and the tag is properly enabled, statistics on the content will soon start to be collected in Yandex Metrica.

Markup example

<html prefix="og:http://ogp.me/ns# article:http://ogp.me/ns/article#">
  <head>
    <title>Moscow breaks the 1922 temperature record</title>
    <meta property="og:type" content="article"/>
    <meta property="og:title" content="Moscow breaks the 1922 temperature record"/>
    <meta property="og:url" content="https://www.example-news.com/life/weather/moscow#cao"/>
    <meta property="article:section" content="Weather">
    <meta property="article:modified_time" content="2018-12-11T08:56:49Z">
    <meta property="article:published_time" content="2018-11-06T09:26:10+04:00">   
    <meta property="article:author" content="John Smith">
    <meta property="article:author" content="Dylan Brown">
    <meta property="article:tag" content="Heat">
    <meta property="article:tag" content="Moscow">
    ...
  </head>  
 <body>
   <div>
     On Wednesday, November 6, Moscow broke the temperature 
      record registered in 1922. The air temperature was 12.1 °C, 
      according to the Fobos center.
   </div>
   ...
 </body>
</html>

Learn more

Chat with us

Write an email

Please note: Our support team will never initiate a call to you. Do not follow any instructions of people who call you and introduce themselves as the Yandex Metrica support team.


Previous