Chapter 9: Salesforce Commerce Cloud Page Meta Tag Rules

Discover an efficient way to build meta tag rules in Salesforce Commerce Cloud with the Page Meta Tag Rules. Read more today!
June 27, 2022

Page Meta Tag Rules


The Page Meta Tag Rules is a portal that is highly powerful, and I definitely recommend my clients to bake it into their SEO project plan if possible. 

See Salesforce Commerce Cloud documentation for using the Page Meta Tag Rules here

The Page Meta Tag Rules portal allows you to create page title and meta description templates for various page types so you can programmatically populate those fields without having to individually add to each page. 

This is especially useful when you have a large website and customized meta data optimizations might be too high of an effort. But please keep in mind, this by no means should be a replacement for any sound keyword research, rather a supplement to your SEO Strategy.

During a website migration project, I typically bake in Page Meta Tag rules into our timeline alongside other high tasks, including building a 301 redirect map. That’s how valuable I see this tool for a website build.

You can create meta rules for,

  • The Home Page
  • Product Detail Pages (PDPs)
  • Product Listing Pages (PLPs / Categories)
  • Content Detail Pages (Content assets)
  • Content Listing Page (Content Folders)

Let’s delve into how to build these page meta tag rules.

Book a Free 30 min. Consultation

Commerce Cloud SEO is a beast but you don’t have to tackle it on your own. Book a free consultation and let’s talk through your challenges.

1. Meta Tag Definitions

Let’s kick off the conversation by looking at the Meta Tag Definitions section found in the Page Meta Tag Rules Dashboard.

This portal allows you to create meta tag definitions. These definitions allow you more flexibility around how you build your meta tags. With that, I think it’s important to start here as it’ll be easier to define actual rules once we walk through the syntax below.

Notice the various rows under “Meta Tag ID” and each have a “Meta Tag Type”. It’s a little confusing at first but let me walk you through the significance behind each column.

To help you understand, let’s review how meta tags are constructed. The below is the HTML Snippet for the Meta Description from my homepage.

<meta name=”description” content=”Hi! I’m Edwin Romero. I’m based out of Chicago and specialize in digital marketing and SEO consulting.” />

The “name” portion in the HTML snippet is the “Meta Tag Type” in the SFCC screenshot above. “name” specifies the name of the metadata. In our example, we’re naming our meta data as “description”.

The “description” portion in the HTML snippet is the “Meta Tag ID” in the Commerce Cloud screenshot above. The “description” helps you pinpoint the meta tag type. In our case, we’re targeting the “Meta Description” tag.

Although it may seem overwhelming at first, once you build your first rule and become acclimated to the process, you can find there are pretty creative ways to use the definitions.

Notice in the above Meta Tag Definitions screenshot, I have the a “google-site-verification” Meta Tag ID. You can even verify Google Search Console and Bing Webmaster Tools with this approach.

Brands have also used the Definitions to build Open Graph Tags and Twitter Cards, which feed the descriptions you find in a Facebook and Twitter link.

2. Building a Rule

Let’s say you choose to build tags for Product Listing Pages, you’d have to go back to the Dashboard and select “Product Listing Page”

From here, you are greeted to something similar to the below.

Let’s break down what we’re seeing above. Please note, I have hidden any client-specific information.

  • Name”: Denotes the name of the Rule you’re building. It doesn’t have a relationship with the “name” component from the Meta Tag Definitions. 
  • Scope”: Targets which page type you’re targeting; in the case above, we’re targeting “Product Listing Page”.
  • Meta Tag ID”: Allows you to pinpoint the meta tag type, such as “description” for Meta Descriptions and “title” for Page Titles.
  • Assignments”: Tells you the total number of assignments this rule has targeted; depending on the rule, you can target select categories and products.

Once you select a Rule / “Name”, you will receive a pop-up similar to the below screenshot.

The area we’ll focus on is the “Rules” Section. This is where your page meta tag rule will be placed.

At this point, we want to build a rule.

Salesforce uses their own syntax to drive the rule but we can assemble using some examples. 

One of the more popular and straight forward rules built for a meta description is the below, with example text.

${IF Category.pageDescription THEN Category.pageDescription ELSE Constant('Shop our wide selection of ') AND Category.displayName AND Constant(' . Shop today!')}

It uses IF, Then and ELSE statements and targets Category attributes (or category traits). In our case, we’re targeting the pageDescription attribute that populates the Meta Description and the Category Display Name, which is the name of the category. The Constant syntax allows the rule to keep specific text across all Meta Descriptions.

With the above rule, we’re saying,

IF a category has a meta description THEN use the current category meta description, or ELSE use the following text “Shop our wide selection of ” and loop in the Category Name and then append following text “ . Shop Today!”

If our target categories have the below Names,

ID (Women Category)Name (Women Category)ID (Men Category)Name (Men Category)
womens-dress-shoesDress Shoesmens-dress-shoesDress Shoes

The meta descriptions for both “womens-dress-shoes” and “mens-dress-shoes” would both read.

“Shop our wide selection of Dress Shoes. Shop Today!”

Success! We’ve built a rule and now we can Save.

Once saved, you can then select the PLPs or categories you’d like to assign the rule.

You’ll be able to select from a Category structure. I’ve worked with brands that have created rules to target all Categories by selecting the parent category or writing rules for a more specific subcategory.

3. A Final Note on Page Meta Tag Rules

I want to leave it here. Although we only talked about Meta Description rules, the logic continues to apply for Page Titles and other tags.

It can be intimidating at first glance but once you’re able to test various rules and the components that drive them, they can be extraordinarily useful and timesaving.

I hope this helps push efficient meta optimizations to your site.

Get in Touch


Subscribe To #PragmaticSEO

Practical SEO advice. Personal SEO advice.

[Active] Blog Post - Side Bar Newsletter Signup

Reach out

[Active] Blog Post - Side Bar Contact Form

☕ Buy me a coffee

I hope you’ve been enjoying these posts.

If so, please considering making a donation to my ☕ coffee fund ☕.

Donations will cover the cost of web maintenance & the coffee needed for brainstorming and implementing new ideas 🤔.