Skip to main content
How-to

How to implement open graph for an Ecommerce Store

By ยท Updated ยท 7 min read

What Open Graph Implementation Means for an Ecommerce Store

Open Graph (OG) implementation means adding structured HTML meta tags to every page of your store so that platforms like Facebook, Pinterest, LinkedIn, and iMessage read your content accurately when someone shares a link. Without these tags, social platforms guess at your title, description, and image โ€” usually pulling the wrong asset or truncating critical product details.

For ecommerce specifically, Open Graph controls how a product link renders in a Facebook post, a WhatsApp message, or a Pinterest pin. A correctly implemented tag set produces a clean card with the right product name, a high-quality image, the correct price, and a direct link to the product. That card is often the first impression a prospective buyer sees before clicking โ€” making accurate implementation a direct revenue concern, not just a technical tidbit.

Step 1 โ€” Audit Your Current Tag State Before Writing a Single Line

Before adding or editing tags, run your homepage, a product page, a collection page, and your blog index through the Meta Sharing Debugger (developers.facebook.com/tools/debug). Note every warning: missing og:image, wrong aspect ratio, no og:type, and stale cache. This audit creates a baseline and prevents duplicate work if your theme already outputs partial tags.

Check for duplicate og: tags โ€” some Shopify themes and WordPress plugins inject default Open Graph tags, and adding a second set causes unpredictable rendering. Use your browser's View Source (Ctrl+U) and search for 'og:title' to confirm how many instances exist. If more than one appears, remove or disable the lower-priority source before proceeding.

Document which page templates exist in your store: homepage, product, collection, cart, account, and 404. Each template needs its own tag logic. Treating them as one group is the most common implementation error that causes product pages to inherit homepage metadata.

Step 2 โ€” Define Your Tag Set for Each Page Template

Every page in your store needs at minimum: og:title, og:description, og:url, og:image, and og:type. Product pages additionally benefit from og:price:amount, og:price:currency, and product:availability โ€” these render price and stock status in Facebook and Pinterest cards natively. Set og:type to 'product' on product pages and 'website' on all other page types.

For og:image, the required minimum dimensions are 1200 ร— 630 pixels at a 1.91:1 ratio. Images smaller than 600px wide will not render as large-format cards โ€” they appear as a thumbnail to the left of text instead. Use your primary product image on product pages. On collection pages, use the collection's featured image or a manually specified campaign asset. Never let og:image default to a logo on a product page.

og:description should be written specifically for social context โ€” 2-3 sentences summarizing the product's core value and key spec without assuming the reader has already seen the page. This copy differs from your meta description because social cards truncate at roughly 300 characters, not 160.

Step 3 โ€” Implement Tags in Your Theme or CMS

On Shopify, open the theme's layout/theme.liquid file. Place your Open Graph block inside the <head> section. Use Liquid variables to make tags dynamic: {{ product.title | escape }} for og:title, {{ product.featured_image | img_url: 'master' }} for og:image, and {{ product.description | strip_html | truncate: 300 | escape }} for og:description. Wrap the entire product tag block in a Liquid conditional {% if template == 'product' %} so product-specific tags only fire on product pages.

On WooCommerce, the Yoast SEO or Rank Math plugins output Open Graph tags automatically if the Social settings panel is enabled. Verify in Settings โ†’ Yoast SEO โ†’ Social that Facebook and Pinterest toggles are on. Then override individual product tags in each product's Yoast panel under the Social tab โ€” this is where you set a social-specific image that differs from the product's main image if needed.

On headless or custom storefronts, add tags directly to the <head> in your page component using server-side rendering. For Next.js, use the next/head component and populate it with data fetched from your product API at build or request time. Never inject Open Graph tags client-side via JavaScript โ€” crawlers and link-preview bots do not execute JavaScript.

Step 4 โ€” Validate, Refresh Cache, and QA Across Platforms

After deploying tags, run each updated URL through the Meta Sharing Debugger again and click 'Scrape Again' to force a cache refresh. Facebook caches OG data aggressively โ€” without a forced scrape, shared links continue showing old data for days. Confirm the debugger returns no warnings and that the preview card displays the correct image, title, and description.

Test Pinterest separately using the Pinterest Rich Pins Validator (developers.pinterest.com/tools/url-debugger). Rich Pins require og:price:amount and og:price:currency to populate correctly. If your product price is dynamic based on variants, ensure the tag outputs the base price or the lowest price point โ€” do not leave it blank.

Share links manually in a private Facebook post, a Slack message, and an iMessage on iOS to verify rendering in real environments. Automated validators sometimes pass tags that render incorrectly due to redirect chains or image hosting restrictions. This QA step takes under ten minutes and catches issues that tool-based validation misses.

Maintaining Open Graph Tags as Your Catalog Scales

For stores with more than a few hundred products, tag implementation must be template-driven and data-bound โ€” manual per-page tagging does not scale. Ensure every new product, collection, and landing page inherits correct OG tags from its template the moment it is published. Build a monthly audit into your SEO workflow using a crawler like Screaming Frog with the 'Custom Extraction' feature configured to pull og:image and og:title values so you can spot missing or broken tags at scale.

When you run a sale, update og:price:amount to reflect the discounted price. Stale price data in social cards erodes trust โ€” a shopper who clicks expecting a sale price and sees full price converts at a far lower rate. Automate this sync if your platform supports it; otherwise build a checklist item into your promotion launch process to force a Meta cache refresh on affected product URLs.

Frequently asked questions

Do Open Graph tags affect SEO rankings directly?

Open Graph tags do not directly influence Google's ranking algorithm โ€” they are read by social platforms, not search crawlers. However, accurate OG tags improve click-through rates from social shares, which drives traffic. More traffic can indirectly signal page quality to search engines. The primary benefit is social rendering accuracy, not a direct ranking factor.

How many Open Graph tags does a product page actually need?

A product page needs at minimum five tags: og:title, og:description, og:url, og:image, and og:type set to 'product'. Adding og:price:amount, og:price:currency, and product:availability enables Rich Pins on Pinterest and price display on Facebook. These eight tags cover the full social card experience. Additional tags like og:site_name and og:locale are useful but not required for functional rendering.

Why is my og:image not showing even though I added the tag?

The three most common causes are: the image is smaller than 600px wide, the image URL returns a redirect rather than a direct file response, or the platform is serving a cached version of the old tag. Run the URL through the Meta Sharing Debugger, click 'Scrape Again', and check the image dimensions reported in the debugger output. Fix the image URL or dimensions, then force a rescrape.

Should collection pages and blog posts have different Open Graph tags than product pages?

Yes. Collection pages use og:type 'website' and a featured collection image. Blog posts use og:type 'article' and include article:published_time and article:author tags where supported. Product pages use og:type 'product' with price and availability data. Using 'product' on non-product pages causes incorrect schema interpretation by Pinterest and Facebook, which can suppress rich card rendering.

How often should Open Graph tags be audited for an active ecommerce store?

Run a full audit monthly for stores with active catalogs. Check for missing og:image tags on new products, stale prices on discounted items, and broken image URLs caused by CDN changes. For stores running frequent promotions, add an OG cache refresh step to every sale launch checklist. A quarterly deep crawl with Screaming Frog's custom extraction covers structural issues that routine checks miss.

MG
Written by

Matt is the founder of RunOctopus. He built All Angles Creatures from zero to page-1 rankings in reptile feeder insects in under 60 days using exactly this method โ€” turning a hard, entrenched niche into RunOctopus's proof store for programmatic SEO and AI search citation.

Connect on LinkedIn →

See what Otto would build for your store

Free architecture preview. No card required. Five minutes.

Generate Preview →