cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to work with meta tags in Hybris?

Former Member
0 Likes
3,776

Hi Experts,

I'm new to hybris and i'm supposed to stdding SEO meta tags to our project, but I have searched here and google and I still do not understand how to do this. I am able to add keywords and description on content pages on cmscockpit, but I cannot add it to the category or product pages. What about new meta tags like o:g or something do I just add to the master.tag? Any clarification on where to start will help. Thank you.

Sincerely,

Charlie Pan

Accepted Solutions (1)

Accepted Solutions (1)

0 Likes

Hi Charlie, By default OotB provides option to add meta keywords at Category and Product level, it is a list. For description, it takes from description field, you can add the data from backoffice or productcockpit(possibly). for these you don't need to customize anything. For opengraph(og) tags, you will have to customize, it doesn't come OotB. You can add new attributes to category or product models, or leverage what the attributes that are already there, depends on how you design it. Hope this helps!

Former Member
0 Likes

Thank you this helps a lot!

Former Member
0 Likes

Hi @Ak M,

Right now I'm testing these functionalities on my local instance. I noticed I can export as csv not sure if i can import though? If not where is the best place to start coding because going through the backoffice seems very repetitive. So far I have gotten success adding keywords to category and content pages. However, when I try to add to product I see the keyword in the productcockpit I make sure it is synced, but it does not show up in the meta tag on the site. Thank you.

0 Likes

Am glad that you got it working for Category and content pages. On your queries,

  1. If you are asking about importing keywords for all categories and products, you can do this via Impex Import.

  2. For product page, do you know if the ProductKeywordsPopulator is getting executed? This is responsible for populating Keywords from Model to Data. It is a configurable populator I believe, you might have to pass it as extra OPTOIN to product facade if it is not getting invoked.

Former Member
0 Likes

@ak M for some reason it does not let me reply to you, but I cannot find ProductKeywordPopulator. Is there already some existing code or we'll have to make our own (I do see other types of populators though). Thanks.

0 Likes

It is present in below package, in acceleratorfacades extension. de.hybris.platform.acceleratorfacades.product.converters.populator.ProductKeywordsPopulator The below code populates keywords to data object. If you still don't get the above populator working, you can add the below code in one of the populators that is working for Product page.

0 Likes
     final List<KeywordModel> keywords = source.getKeywords();
                 // Remove duplicates
                 final Set<String> keywordSet = new HashSet<String>(keywords.size());
                 for (final KeywordModel keyword : keywords){
                     keywordSet.add(keyword.getKeyword());
                 }target.setKeywords(keywordSet);

Answers (2)

Answers (2)

0 Likes

Hi Hsin

If you wish to achieve some SEO leverage by configuring meta keywords, then here is the news - "The Meta Tags are not used by Google now".

For further reading on this please see this link: https://datadrivenlabs.io/blog/meta-keyword-tag-google-2018/

Still, if there is a requirement to configure the meta tag keywords then, as per the hybris directives-

The default meta keywords are set as follows:

  1. Product Page: productData.keywords (This is not implemented OOB)

  2. Category Page: category.keywords (Catalog->Categories->Select a category->keywords)

  3. Search Results Page: search terms

  4. Store Search Results Page: search terms

  5. Store Page: store.city, store.postcode, store.country

  6. Content Page: page.keywords (Any content page) (WCMS->Homepage->Description)

Some additional information - The default meta descriptions are set as follows:

  1. Product Page: product.summary (Catalog->Products->Select a Product->Summary)

  2. Category Page: category.description (Catalog->Categories->Select a category->description)

  3. Search Results Page: Search results for search terms on storefront.name

  4. Store Search Results Page: storefront.name Store Locations near to

  5. Store Page: store.description(Store Locator Page -> Description)

  6. Content Page: contentPage.description (Any content page) (WCMS->Homepage->Description)

Hope this helps!

Former Member
0 Likes

I have seen this article but it is a client requirement. This really helps though :)

Former Member
0 Likes

Ootb you can find keywords under catalog in HMC/backoffice. There you can create the keywords and assign the products/categories you want.