Magento 2 Google Rich Snippets

Installation and User Guide for Magento 2 Rich Snippets for Google, Microsoft and Yahoo

Table of Contents

  1. Installation

    • Installation via app/code

    • Installation via Composer

  2. Configuration Settings for Rich Snippets

    • General Settings

    • Rich Snippets General Settings

    • Twitter Card Settings

    • Facebook Open Graph Settings

    • Pinterest Rich Pins Settings

    • Free Shipping (Website Level)

    • Price Valid Until

  3. Structured Data / Markup Code of Front-end Page(s) in Structured Data Testing Tool

    • Home Page Markup Code

    • Category Page Markup Code

    • Product Page Markup Code

    • Twitter, Facebook Open Graph Social Sharing Code

    • Increased and Optimized Page Ranking in Search Results

Installation

  • Installation via app/code: Upload the content of the module to your root folder. This will not overwrite the existing Magento folder or files, only the new contents will be added. After the successful upload of the package, run below commands on Magento 2 root directory.

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
  • Installation via Composer: Please follow the guide provided in the below link to complete the installation via composer.

pageInstallation Via Composer

Configuration Settings for SEO Base

Go to Admin > Stores > Configuration > Scommerce Configuration > SEO Base

General Settings

  • Enabled – Select “Yes” or “No” to enable or disable the module.

  • License Key – Please add the license for the extension which is provided in the order confirmation email. Please note license keys are site URL specific. If you require license keys for dev/staging sites then please email us at support@scommerce-mage.com.

Configuration Settings for Rich Snippets

Go to Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet

General Settings

  • Enable - Select “Yes” or “No” to enable or disable the module.

  • Description – Select description/short description from the drop down.

  • Price – Select Price from the drop down. In case price is listed with tax and without tax select which price should be used.

  • Brand – Select brand from the drop down.

  • Global Product Identifier – Select product identifier from the drop-down list.

  • Global Identifier Type – Select product identifier type from the drop-down list. It could be one of the following: gtin8, gtin13, gtin14, mpn.

Rich Snippets General Settings

  • Enable - Select “Yes” or “No” to enable or disable the module.

  • Description – Select description/short description from the drop-down.

  • Price – Select price from the drop down. In case price is listed with tax and without tax select which price should be used.

  • Wrap with div – Select “Yes/No”. It helps prevent conflicts with SEO extensions.

  • Use JSON-LD – Select “Yes/No” use JSON-LD format for product snippet.

Twitter Card Settings

  • Enable - Select “Yes” or “No” to enable or disable the module.

  • Card Type – Select the card type.

  • Description - Select description/short description from the drop down.

  • Price – Select price from the drop down. In case price is listed with tax and without tax select which price should be used.

  • Twitter Site – Set Twitter site name (@ username for the website used in the card footer)

  • Twitter Creator – Set Twitter creator name (@username for the content creator / author)

Facebook Open Graph Settings

Facebook Open Graph Settings

  • Enable – Set “Yes” to enable.

  • Description – Select description/short description from the drop down.

  • Price – Select price from the drop down. In case price is listed with tax and without tax select which price should be used.

  • Site Name – Set Facebook site name.

  • App ID – Set Facebook App ID.

Pinterest Rich Pins Settings

  • Enable – Set “Yes” to enable Pinterest Rich Pins . It uses same tags as Facebook open graph, make sure Facebook Open graph is enabled as well.

Free Shipping(Website Level)

Some settings are only available on the website level for eg:- Region/State.

  • Show free shipping- Select “Yes” or “No” to add or remove free shipping schema from the product page.

  • Country – It determines which country will have free shipping for the selected website

  • Region/State – It determines which state within the selected country will have free shipping for the selected website

  • Base Currency - Added as a part of free shipping schema, set 'YES' to allow use of base currency of the website otherwise the currency chosen by the customer.

Price Valid Until

Send Price valid until with the offers markup code for products.

  • Start Month- Select the starting month from where the priceValidUntil field will be calculated. for example:- if you select the month of January then the calculations for the field will start from january.

  • Time Interval- Select "quarterly", "Six-monthly", or "Yearly" based upon the selection the price valid until date will be calculated. Example:- if the start month is January and the current date is 23-11-2023 and the time interval selected is "Six-monthly" then the first six-monthly is between 01-01-2023 to 31-06-2023 and the second six-monthly period is between 01-07-2023 to 31-12-2023 hence the priceValidUntil will be 31-12-2023 as our date lies in this period.

Structured Data / Markup Code of Front-end Page(s) in Structured Data Testing Tool

  • Home Page Markup Code - You can add structured data/markup code on home page from, Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet > Enable - Select "Yes". To test structured data, go to Structured Data Testing Tool > Provide Home Page URL > Click "Run Test" button.

  • Category Page Markup Code - You can add markup code, breadcrumbs on category page from, Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet > Enable - Select "Yes".

  • Product Page Markup Code - To add structured data markup code on product page, set "Show free shipping" to "Yes" from, Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet>Free Shipping.

Shipping Markup Code - To add structured data markup code on product page, set "Enable" to "Yes" from, Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet.

Price Valid Until - To add the price valid until date with the structured data markup code on the product page, Set the "Start Month" and the "Time Interval" from, Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet > Price Valid Until.

Twitter, Facebook Open Graph Social Sharing Code

  • Twitter Card - You can enable Twitter Card from, Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet >Twitter Card Settings > Enable - "Yes".

  • Facebook Open Graph - Enable Facebook Open Graph from, Admin > Stores > Configuration > Scommerce Configuration > Rich Snippet >Twitter Card Settings > Enable - "Yes".

  • Increased and Optimized Page Ranking in Search Results - In the below image you can see the increased and optimized page ranking in search results.

Set Primary Categories

You can use a script provided with the extension to automatically add primary categories for products. Admin can exclude certain categories from primary category and also prioritise one category over the other to be picked as the primary category.

Go to Admin>Catalog>Categories select a category then scroll down to find the option "Primary Category Settings". Here click on "Exclude From Primary Category" to exclude this category from primary category or enter the priority 0 being the highes. The highest priority category will be picked first for the primary category.

To automatically assingn primary category for all products run the command given below by going into the root directory of your store.

scommerce:seo-base:set-primary-category

N.B - If you are using older version then run the script provided in the extension folder at the path Data/SetPrimaryCategoryM2.php from ssh

If you have a question related to this extension please check out our FAQ section first. If you can't find the answer you are looking for then please contact support@scommerce-mage.com.

Last updated