Meta Tag Rules

Page meta tags are used in HTML documents to provide structured data about a web page. Depending on your requirements and integrations, you have to manage your content to provide meaningful data for those tags. Salesforce B2C Commerce provides a rule-based solution that enables you to generate and manage the corresponding content for your storefront.

Using Business Manager, you can:

  • Define meta tags for product and content detail and list pages. A list page uses a search model where the method is located.
  • Define general rules for creating meta information. Though meta descriptions no longer impact website rankings, they serve as snippets for users, and can influence the click through rate and traffic when customers click the links.

You generate and manage meta tag content for product and content detail and list pages with rules (created using B2C Commerce Script API) that are managed in the Page Meta Tag Rules page.

  • HomePage: manage rules for the site’s home page.
  • Product Listing Page: manage rules for category or product listing pages (PLP) and product detail pages (PDP).
  • Product Detail Page: manage rules for product detail pages (PDP).
  • Content Listing Page: manage rules for content folder or content listing pages (CLP) and content detail pages (CDP).
  • Content Detail Page: manage rules for content detail pages (CDP).

Rule Inheritance

Page meta tag rule lookup follows an inheritance scheme that enables you to minimize rule configurations. Rules on your root category (folder) are visible within all child categories (folder) and assigned products (content). Rules are inherited within the current locale context first, before the locale fallback, as defined in language settings.

The lookup rules are applied as follows:

Page type Fallback
Product detail page (PDP)
  • Current product
  • Variation groups
  • Main
  • Primary category assigned to the site for which the request is processed
  • Parent categories, up to root
  • Locale Fallback and start at current product in new locale
Content detail page (CDP)
  • Current content
  • Primary folder
  • Parent folders, up to root
  • Locale fallback and start at current content in new locale
Product list page (PLP)
  • Current category
  • Parent categories, up to root
  • Locale fallback and start at current category in new locale
Content list page (CLP)
  • Current folder
  • Parent folders, up to root
  • Locale fallback and start at current folder in new locale

Script API

In addition to creating your rules following the meta tag rule syntax, you can also use APIs to obtain page meta tags that are generated based on rules.

Import and Export

You can import and export your definitions via Creating Page Meta Tag Rules.

Best Practices

When creating meta tag rules, consider following these recommendations:

Page Title and Meta Titles

  • Every URL is supposed to have a page title.
  • Every URL is supposed to have a unique page title.
  • Include the primary keywords of the page in the page title.
  • Don’t exceed 70–71 characters in the page title.
  • Optimize the page title for the user.

Meta Descriptions

  • Optimize meta descriptions for the user with AIDA principle (Attention, Interest, Desire, Action).
  • Don’t exceed 156 characters for the meta description.