*Can be applied to orders starting from $199
Rating 0 stars - 0 votes

Magento 2 Structured Data Markup: Schema.org and Google Tag Manager

Your search result rankings can be considerably optimized by using Magento 2 rich snippets or structured data markup. Rich snippets show some additional information about a product, e.g. it's rating, price, photo, availability etc., that's why they are called rich. Such details displayed in your snippet will make it look well presented and will probably be primarily noticed by users.

How Can I Get Magento 2 Rich Snippets?

In order to make more information displayed in your snippets, you have to add structured data markup to your website.


Structured data is a piece of code of specific format used by search engines to create rich snippets.

Schema.org is considered to be the best alternative for generating rich snippets. This project was developed by most popular web search engines for providing code examples for particular cases.

Below you can find the detailed instructions on how to configure Magento 2 structured data using Schema JSON-LD method along with Google Tag Manager.

Schema.org And Google Tag Manager

In order to successfully implement structured data markup on your site, it is recommended to use Google Tag Manager. This tool can greatly speed up the process of creating rich snippets as it allows creating tags on different pages using the same piece of code. For example, if you want to specify product price in every page snippet, you can create tag 'Price', so the price will be taken from every product page and displayed in its snippet.


Tags will work properly only if you configure triggers. Triggers are the conditions for Google Tag Manager to use this or that tag. So if you do not want to place one and the same tag in each and every snippet, you need to tell Tag Manager when to use specific tags.


Besides, GTM allows creating variables, e.i. separate URLs or page elements like buttons or headings for dynamic generation of structured data. The relation between a tag and a variable is the following: if the variable meets the conditions of a trigger, the tag will be used.

Add JSON-LD Code to Your Magento 2 Using Google Tag Manager

Here are detailed guides on how to add JSON-LD structured data to your site:

  1. If you are not sure if you can create JSON-LD code by yourself, it is possible to generate it using Schema JSON-LD Generation Tool. Just select the necessary properties to be included in the markup and copy it to the clipboard.



  2. Go to Google Tag Manager and create a custom HTML tag and name it.



  3. Paste the generated code to Custom HTML text box and press 'Save'.



  4. On the popped-up window, press 'Save tag' button (ignore the message that the trigger is not chosen).



  5. Add a trigger to the created tag.



  6. Select its type (Page View) and specify what pages it should fire on.



  7. Underneath indicate the conditions on which the tag should work.



  8. Open the custom HTML page you've created on step 2 and choose the trigger for the tag (in our case it is Page View).
  9. In case you want to create the same tag for different pages but make it fire on different conditions, you should create variables for this tag:

    • Press 'New' button and name the variable;


    • Go to 'Variable' configurations and choose the variable type;


    • If you select Dom Element type, specify the selection method (CSS Selector in our case), Element selector (for example, H1) and Attribute name.



    • Add the generated variable to the custom HTML page.

  10. Press red 'Publish' button to apply the changes.

  11. To check the accuracy and the validity of the produced code, you can use Structured Data Testing Tool. Just enter the URL to the page containing structured data and press 'Run Test' button.

The implementation of structured data markup to your Magento 2 may seem not so easy, although it can make a great contribution to your SEO. By setting up rich snippets with Google Tag Manager you assist Google in the understanding of when and how to show your pages. That's why it can optimize your positions in search results.



COMMENTS
Be the first to comment.