How to add a Facebook LIKE button to your Shopify store
Adding a Facebook “Like” or “Recommend” button to product and blog pages lets your customers promote and share your products and content with their own friends and family. Use the steps below to add a Facebook Like or Recommend button to your online store’s, products and blog posts.
- From your Shopify admin, go to Online Store > Themes.
- Find the theme you want to edit, and then click Actions > Edit code.
- In the Layout section, click theme.liquid to open the file in the online code editor.
- Include the JavaScript SDK on your page once, ideally right after the opening
<body>
tag.12<div id="fb-root"></div><script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v4.0&appId=364831677646201&autoLogAppEvents=1"></script> - Place this code wherever you want the plugin to appear on your each pages. Example:
Product Pages1<div class="fb-like" data-href="{{shop.url}}{{product.url}}" data-width="" data-layout="button" data-action="recommend" data-size="large" data-show-faces="true" data-share="true"></div>
Blog posts1<div class="fb-like" data-href="{{shop.url}}{{article.url}}" data-width="" data-layout="button" data-action="like" data-size="large" data-show-faces="true" data-share="true"></div> - Save and you are done.