Facebook Open Graph ID

Solved
23ra1
Tourist
11 0 3

Hello there

Currently trying to set up Open Graph for my products on Shopify.

Everything is working properly, except for the Open Graph ID.

  <meta property="og:type" content="product">
  <meta property="og:title" content="{{ product.title | strip_html | escape }}">
  <meta property="og:id" content="{{ product.variant.id }}"> // this does not workk

 

But the ID is not being recognized, perhaps for 1 of 2 reasons:
- either the og:id is the wrong syntax for this, or

- the {{ product.variant.id }} is the wrong syntax.

Can anyone please help me with this? :) Thank you!

0 Likes
KarlOffenberger
Shopify Partner
1867 182 777

This is an accepted solution.

Is id even a standard object property? Not a specialist here, but IIRC you don't set any og:id. I recall og:app_id or something like that, but that's about it. Best check the open graph docs.

Liked this post? You might also like our fantastic upsell apps Candy Rack and Candy Cart or offer free gifts with Gift Box. All made with ❤️  and care by Digismoothie
23ra1
Tourist
11 0 3

Thank you, Karl, that was exactly it :)

gofuturefresh
Excursionist
80 1 2

My image is not showing properly.

Scraped mine and this shows: 

 

https://developers.facebook.com/tools/debug/og/object/?q=http%3A%2F%2Ffuturefresh.ph%2F

 

Warnings That Should Be Fixed
Inferred PropertyThe 'og:url' property should be explicitly provided, even if a value can be inferred from other tags.
Inferred PropertyThe 'og:title' property should be explicitly provided, even if a value can be inferred from other tags.
Share App ID MissingThe 'fb:app_id' property should be explicitly provided, Specify the app ID so that stories shared to Facebook will be properly attributed to the app. Alternatively, app_id can be set in url when open the share dialog.

 

How do I fix this?

 

0 Likes
Hassan_Zahid
New Member
3 0 0

Hey Karl - seems it worked for you. Could you please share exactly what we're suppose to type out in the code? Kind of a newbie here;

 

<meta property="og:site_name" content="{{ shop.name }}">
<meta property="og:url" content="{{ og_url }}">
<meta property="og:title" content="{{ og_title }}">
<meta property="og:type" content="{{ og_type }}">
<meta property="og:description" content="{{ og_description }}">
<meta property="og:app_id" content="{{ og_app_id }}">
{% if template.name == 'product' %}
<meta property="og:price:amount" content="{{ product.price | money_without_currency | strip_html }}">
<meta property="og:price:currency" content="{{ shop.currency }}">
{% endif %}

0 Likes