Skip to main content
Ab dem 30. Oktober 2026 ist die online Trailblazer Community schreibgeschützt, da wir neue Community-Unterhaltungen zu Slack verschieben. Hier finden Sie häufig gestellte Fragen zu diesem Thema

Configure Page Meta Tag Rules

Learning Objectives

After completing this unit, you'll be able to:

  • List the five Salesforce B2C Commerce meta tag scopes.
  • List the three basic meta tag settings.
  • Explain the benefits of using static and dynamic text.
  • Configure a page meta tag rule in Business Manager.
  • Describe how you preview meta tags.

You just learned what meta tags are and how rule inheritance works. Now, let’s see how to automatically generate unique, keyword-rich descriptions on every product detail page of your storefront. B2C Commerce builds that content from rules you write with a page meta tag rules syntax. In this unit, you learn the syntax and the settings to write effective, unique meta tags that attract shopper interest.

Start with two basic concepts: scope and elements.

  • Scope: Answers where and in what context does this rule apply.
  • Elements: Define the components of the rule content.

Together they're the two concepts you need to understand before you write and configure rules in Business Manager.

Explore Scope

Scope defines the context in which B2C Commerce evaluates a page meta tag rule. Each scope uses a specific set of operators. Here are the five scopes that you configure in Business Manager.

  • HomePage
  • Product detail page (PDP)
  • Product listing page (PLP)
  • Content detail page (CDP)
  • Content listing page (CLP)

Product scope, for example, defines rules for meta tags on a product detail page. Each scope reaches scope-relative data. You access the category object for PLP and PDP, but not for CLP or CDP. The site context works across every scope. Here's how the operators and objects map to the scopes.

Scopes

Operators and Objects

All scopes

  • Script operators:
    • or
    • and
    • else
    • if-then
    • equals
  • Site context
  • Host context
  • Print a static constant value
  • Original request URL

List pages

  • Search refinements
  • Search phrase

Product list and detail pages

  • Category object

Content list and detail pages

  • Folder object

Product detail pages

  • Product object
  • Product price
  • Product image URL

Content detail pages

  • Content object

Explore Elements

Page meta tag rules have both static and dynamic elements.

Configure Static Text

Static elements are literal text. B2C Commerce copies them into the meta tag exactly as you type them, with no lookup or evaluation.

You typically combine static text with a dynamic element, like this:

Some static text with dynamic part ${expression} here.

Depending on what ${expression} evaluates to, B2C Commerce generates different output:

${expression} evaluates to

B2C Commerce generates

(empty)

Some static text with dynamic part here.

Dynamic String Value

Some static text with dynamic part Dynamic String Value here.

Print Static Text on a Condition

When you write rules, if something evaluates true, you print specific static text. Here's an example that generates a robots page meta tag with the IF-THEN and Constant operators.

${IF SearchRefinement.refinementColor OR SearchPhrase THEN Constant('noindex,nofollow') ELSE Constant('index,follow')}

When no color is selected and no search phrase is set, B2C Commerce generates the content: 'index,follow'. When a color or a search phrase is set, B2C Commerce generates the content: 'noindex,nofollow'.

Configure Dynamic Text

You define dynamic elements within the script syntax, in this format: ${dynamic-expression-here}. B2C Commerce evaluates each dynamic expression and prints the resulting value instead of the expression itself. A dynamic expression contains operators and objects. Dynamic text in meta tags reaches certain objects and their values: Product, Category, Folder, Content, and Site. You access the defined system and custom values for these objects, except for defined passwords and unsupported value types. Here are the supported and unsupported object attribute types.

Supported

  • String
  • Text
  • Integer
  • Number
  • Boolean
  • Email
  • Set of strings
  • Set of integers
  • Set of numbers
  • Enum of strings (only if Multiple isn’t marked)
  • Enum of integers (only if Multiple isn’t marked)

Not supported

  • HTML
  • Date
  • Date+Time
  • Image
  • Password

Here's a script that pulls dynamic values from three objects.

Find ${Product.name} in ${Category.displayName} today | ${Site.displayName}

That script generates content like this.

Find Brand X Evening Dress in Womens Dresses today | Your Company Site

You write the rule text one time, and B2C Commerce fills in the product, category, and site values for each page. Next, you enter this kind of rule into Business Manager.

Configure Meta Tag Rules

In this module, we assume you're a B2C Commerce merchandiser with the proper permissions for these tasks. If you're not a merchandiser, that's okay. Read along to learn how your merchandiser takes these steps in a sandbox instance. Don't try these steps in your Trailhead Playground, because B2C Commerce isn't part of the Playground.

Here's how you configure a meta tag rule.

  1. In Business Manager, select App Launcher, and then select Merchant Tools | Site | SEO & Discoverability | Page Meta Tag Rules.

In Business Manager, the SEO meta tag dashboard.

  1. To see a filtered view of the current meta tags within a scope, click the scope title or the number in the middle of the scope tile.
  2. Check whether the Meta Tag ID you want already exists.
    B2C Commerce comes with a few predefined Meta Tag IDs, such as description. If the tag you want isn't already listed, you must create it before it appears in the Meta Tag ID dropdown in the next step. This is especially important for JSON-LD or any other custom tag type.
    To create a new meta tag definition:
    • Click Add.
    • In the Create Page Meta Tag dialog, enter a Meta Tag ID, such as product-structured-data.
    • For Meta Tag Type, select the type you need, such as JSON-LD.
    • Click Add.
      The new definition now appears in the Page Meta Tags list, and is available to select when you create a rule.
  1. Click New.
  2. Configure these settings.
    • Name the meta tag: ProductDetail01
    • Verify that the scope is correct: Product Detail Page
    • Select a Meta Tag ID: description
      This example uses the predefined **description** Meta Tag ID. To use a different tag, select the definition you created in step 3.
    • Select a locale: Default
    • Enter the meta tag rules.
      ${Product.pageDescription} | ${Site.displayName} - Available at Your Online Store Today! Shop designer evening gowns and apparel
      Each rule holds up to 4000 characters.
    • Enter a description: Description meta tag for product detail page
    • Save your work.

In Business Manager, create a new meta tag rule.

  1. To assign the meta tag, go to the respective filtered scope view.
  2. Find the meta tag in the list and click the number in the Assignments column.
  3. Select an assignment in the Assignments dialog. Be as broad or as detailed as you want. All children inherit the assigned rules.
  4. Click Select.

No index rebuild happens to apply the rule, but the change takes up to 30 minutes to finalize. Depending on how large your catalog is, you write multiple rules and override rules at a child category level.

Preview Page Meta Tag Rules

You want to preview your new page metadata before shoppers see it. Meta tag rules live in a few places in Business Manager, and the interface for each one is similar. Here are the navigation paths.

Page

Path

Home page rules for sites

Administration | Sites | Manage Sites | SiteID

Detail and list page rules for products

Merchant Tools | Site | Products and Catalogs | Catalogs | catalogID

Detail and list page rules for content

Merchant Tools | Site | Content | Libraries | libraryID | folderID

Detail page rules for product

Merchant Tools | Site | Products and Catalogs | Products | productID

Detail page rules for content

Merchant Tools | Site | Content | Libraries | libraryID | folder | contentID

For example, let’s review the product detail page. Here's how you preview a rule.

  1. In Business Manager, select App Launcher, and then select Merchant Tools | Site | Products and Catalogs | Products
  2. Search for a product to test.
  3. Click the product name link.
  4. Click the Page Meta Tag Rules tab.
  5. Select a locale: Default.
  6. Select the scope: Product Detail Page.

Search for a product to get a preview of the defined detail page rules. (For the Product Listing Page scope, add a search filter to test rules based on SearchRefinements or SearchPhrase.)

In Business Manager, product detail page meta tag rules.

  1. Review the page meta tag IDs, rules, and content that display.

Next

In this unit you learned about scopes and elements and how static and dynamic text work together to generate effective, unique meta tags across your pages, products, and URLs. You configured a rule in Business Manager, assigned it to a category, and previewed the result. Next, you learn how to integrate meta tag generation into your storefront app and how to test and plan for meta tag changes.

Resources

Teilen Sie Ihr Trailhead-Feedback über die Salesforce-Hilfe.

Wir würden uns sehr freuen, von Ihren Erfahrungen mit Trailhead zu hören: Sie können jetzt jederzeit über die Salesforce-Hilfe auf das neue Feedback-Formular zugreifen.

Weitere Infos Weiter zu "Feedback teilen"