Shopify embed social meta tags instructions

In case your Shopify theme have not supported social meta tags yet, you can embed these code to your Shopify theme to help social networks sharing the right information.

You may need a developer to help you.

Step 1. Log into Shopify Admin. Go to Online Store / Themes and select ActionsEdit HTML/CSS.
Step 2. Edit file theme.liquid in the Layout folder and paste following code before </head> tag.
<!-- Find Current URL for og:url-->
{% assign current_url = '' %}
{% case template %}
 {% when 'page' %}
 {% assign current_url = page.url %}
 {% when 'blog' %}
 {% assign current_url = blog.url %}
 {% when 'article' %}
 {% assign current_url = blog.url %}
 {% when 'collection' %}
 {% assign current_url = collection.url %}
 {% when 'product' %}
 {% assign current_url = product.url %}
{% endcase %}
<!-- End Find Current URL -->

<!-- Facebook Open Graph -->
{% if template contains 'product' %}
 {% for image in product.images limit:3 %}
 <meta property="og:image" content="http:{{ image.src | product_img_url: 'master' }}">
 <meta property="og:image:secure_url" content="https:{{ image.src | product_img_url: 'master' }}">
 {% endfor %}
{% endif %}

<meta property="og:url" content="{{ shop.url }}{{ current_url }}" />

{% if template contains 'product' %}
 <meta property="og:description" content="{{ product.description | strip_newlines | strip_html | truncate: 300 | escape }}">
{% elsif template contains 'collection' %}
 <meta name="og:description" content="{{ collection.description | strip_html | strip_newlines | escape }}" />
{% elsif template contains 'page' %}
 <meta name="og:description" content="{{ page.content | strip_html | strip_newlines | escape }}" />
{% elsif template == 'index' %}
 <meta name="og:description" content="{{ shop.description | strip_html | strip_newlines | escape}}" />
{% endif %}

{% if template contains 'product' %}
 <meta name="og:type" content="product" />
 <meta property="og:title" content="{{ product.title | strip_html | escape }}">
 <meta property="og:category" content="{{ product.type }}" />
 <meta property="og:price:amount" content="{{ product.price | money_without_currency | stip_html | escape | remove: ',' }}">
 <meta property="og:price:currency" content="{{ shop.currency }}">
 <meta property="og:availability" content="{% if product.available %}instock{% else %}oos{% endif %}" />
{% else %}
 <meta name="og:type" content="website" />
 <meta property="og:title" content="{{ page_title }}" />
{% endif %}
<!-- End Facebook Open Graph -->
Step 3. Click SAVE at the top right and use this Facebook debug tool to refresh your page cache.
https://developers.facebook.com/tools/debug/