# SEO - OpenGraph Tags

> OpenGraph + Twitter Card metadata on product, category and CMS pages — proper image dimensions, alt text and resized og:image for large-card previews.

<Admonition type="warning" title="Important">
qoliber SEO OpenGraph Tags is a stand-alone commercial product, currently available to qoliber extensions licensees only.
</Admonition>

## General Information

Every time someone shares a product, category or article from your store on Facebook, LinkedIn, X (Twitter) or any chat app, the social platform reads OpenGraph and Twitter Card meta tags off the page to render the link preview. Get them right and your link shows up as a large, image-rich card that converts. Get them wrong — missing image dimensions, raw multi-megabyte image files, no alt text — and LinkedIn silently downgrades to a 40×40 thumbnail and Facebook strips your image entirely.

The Qoliber SEO OpenGraph Tags extension emits the full social-metadata stack the platforms actually want to render large previews. Out of the box. On every product, category and CMS page.

## What Does This Extension Do?

- **OpenGraph tags on products, categories and CMS pages** — `og:title`, `og:description`, `og:image`, `og:url`, `og:type`, `og:site_name`.
- **Product-specific tags** — `product:price:amount`, `product:price:currency`, `product:availability` for retail-aware sharing experiences.
- **Twitter Card tags** — `twitter:card="summary_large_image"`, `twitter:title`, `twitter:description`, `twitter:image:alt`.
- **Full social-image metadata** — `og:image:width`, `og:image:height`, `og:image:alt` plus their Twitter equivalents. These are the fields that flip LinkedIn from a 40×40 thumbnail to a full card.
- **Properly-sized og:image** — emits a 700×700 resized variant of your product image, not the raw 4 MB original. Crawlers fetch one image, not the whole gallery.
- **Configurable og:title prefix** for store-wide branding (e.g., "MyStore — ").
- **Plugs into `SeoImagesFriendlyUrl`** so the OG image uses the same SEO-friendly filename as the storefront — keyword-rich, consistent with what the customer sees.
- **Module-disable enforcement** — when the module is off, layout observers leave Magento's default behaviour completely untouched.

## Why Is This a Game Changer?

- **LinkedIn and Facebook will actually render your card.** Both platforms silently downgrade previews when image dimensions or alt text are missing. We emit them by default.
- **No more 4 MB social images.** The resized 700×700 variant cuts the social platform's fetch time, makes previews appear faster on the share dialog, and keeps your bandwidth bill down.
- **Consistent images across surfaces.** The same SEO-friendly filename used on your category and product pages flows through to social, so the URL itself reinforces the keywords.
- **Accessible by default.** `og:image:alt` and `twitter:image:alt` are emitted from real product data — improving accessibility scores in Lighthouse and screen-reader experience on social aggregators.

## How Does It Work?

The module attaches layout observers that, when enabled, populate the `<head>` of product, category and CMS pages with OpenGraph and Twitter Card meta tags. Image URLs are resolved via Magento's `Magento\Catalog\Model\Product\Image\UrlBuilder` (overridden via DI preference so the SEO-friendly URL flows through), and image dimensions come from Magento's `product_page_image_medium` view config (700×700 by default).

### Example output on a product page

```html
<meta property="og:title" content="MyStore — Blue Yoga Pants">
<meta property="og:type" content="product">
<meta property="og:url" content="https://mystore.com/blue-yoga-pants.html">
<meta property="og:image" content="https://mystore.com/media/catalog/product/cache/.../blue-yoga-pants.jpg">
<meta property="og:image:width" content="700">
<meta property="og:image:height" content="700">
<meta property="og:image:alt" content="Blue Yoga Pants">
<meta property="og:site_name" content="MyStore">
<meta property="product:price:amount" content="79.00">
<meta property="product:price:currency" content="EUR">
<meta property="product:availability" content="in stock">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image:alt" content="Blue Yoga Pants">
```

### Configuration at a glance

Find the module under **Stores → Configuration → Qoliber → SEO: Opengraph Tags**. Set your og:title prefix and toggle the per-page-type emission. The image plumbing is automatic.

## What's New in 2.1

- **Full social-compliance tags** — `og:image:width`, `og:image:height`, `og:image:alt`, `twitter:image:alt`. LinkedIn previews go from 40×40 to full card.
- **Resized og:image** — emits the 700×700 variant instead of the raw original; massive bandwidth saving on every shared link.
- **Image URL parity** — the OG image now uses the same SEO-friendly filename as the storefront gallery (when `SeoImagesFriendlyUrl` is enabled).
- **Module-disable bug fixed** — disabling the module now actually disables it. (Pre-2.1, it could leave product pages with no OG tags at all.)
