facebook

Social media is one of the best ways to drive attention to your brand, especially in eCommerce. But that's not the only benefit. You can also drive more traffic to your store and increase sales correspondingly. There's just one thing — the links you share on social media have to be attractive to drive clicks. 

That's something OG tags help you with. So, today you'll learn how to implement OG tags in Magento directly in the admin panel, using only Magento 2 Facebook Open Graph Tags Extension.

Configure Open Graph Tags in Magento

Before you start setting up OG tags for specific pages, you must configure default Open Graph tags. 

1. Enable the extension at Stores > Configuration > Magefan Extensions > Open Graph > General.

2. Specify your Facebook App ID

3. Choose pages to Use Open Graph Meta Tags For.

Note: you can set OG tags for blog only if you use Magefan Blog Extension.

4. Fill out Default OG Image and Description. They are used in case no other OG image or description is defined. 

configure og tags in magento

Don't forget to Save the settings before moving to the next steps.

Add OG Tags to Magento Pages

Open Graph Tags options are the same for all Magento pages. Nonetheless, we'll cover all of them in detail to guide you through the process step by step.

Note: if you don't specify the OG Title and Description for any Magento page, the extension will use the meta title and description of a page. If these are not set either, the page name and default OG description will be used.

Save goes for the OG Images. If you don't upload any OG images, the default OG image will be used.

Products

First, navigate to Catalog > Products and find a product you are interested in. Then scroll down to the Open Graph Metadata section and specify OG Title and OG Description.

magento product og tags

Finally, move to the Images and Videos section, choose an image and tick the OG Image Role for it.

magento product og image

Remember to Save a product once you finish and give it a test by sharing a link on Facebook.

facebook post magento product

Categories

To set OG tags for categories, first go to Catalog > Categories and choose a category you'd like to add the OG tags to. Find an Open Graph Metadata section and fill out OG Title, Description and Image options.

og tags for magento categories

Once you finish don't forget to Save a category and check its link on Facebook.

facebook post with magento category

CMS Pages

Navigate to Content > Pages and scroll down to a page needed. Once there, find the Open Graph Metadata section and specify the required OG data.

og tags for magento cms page

Don't forget to Save a page and check it by sharing a link on Facebook.

facebook post magento cms page

Validate OG Tags

Although we've shared the examples of different Magento pages directly on Facebook, you still need to validate OG tags before posting a link. You can do that with the free Facebook Debugger tool.

facebook debugger

In the best scenario, you'll see your OG image, description and title. However, if something is wrong, this tool will give you feedback on what needs to be fixed. Most often Facebook won't show the OG image due to a variety of reasons.