The client operates multiple microsites under different domains. However, in Google Search results, the website name for some existing indexed microsites is incorrect, outdated, or inconsistent.
This article outlines the issue, Google’s rendering behavior, and the implemented solution using JSON-LD structured data to ensure each microsite has accurate SEO metadata aligned with its domain and branding.
- Google is displaying the wrong website name for some previously indexed microsites.
- The issue persists even after re-submitting reindexing requests in Google Search Console.
- The client uses SuiteCommerce Advanced (SCA), which relies heavily on JavaScript rendering.
- Googlebot often renders the page without JavaScript, causing essential metadata like site name and URL to be missed or ignored.
To ensure that each microsite:
- Has a distinct and correct site name in Google Search listings.
- Defines its name and domain clearly in a structured and machine-readable format.
- Avoids incorrect fallback logic by Google’s crawler.
Solution Overview
Inject JSON-LD structured data in the <head> section of every microsite page to define the correct:
- @type: WebSite
- name: site/microsite name
- url: microsite domain
Additionally:
- Update existing <meta property=”og:site_name”> and og:provider_name dynamically.
- Include accurate structured data for Product pages via getJsonLd().
Implementation Steps
1. Inject WebSite Schema in <head>
var layout = container.getComponent(‘Layout’);
if (layout) {
if ($(‘head script[type=”application/ld+json”]’).length === 0) {
$(document).ready(function () {
const jsonLdScript = $(‘<script>’, { type: ‘application/ld+json’ });
jsonLdScript.text(JSON.stringify({
“@context”: “https://schema.org“,
“@type”: “WebSite”,
“name”: SC.CONFIGURATION.get(‘micrositeSolution.siteName’),
“url”: `https://${SC.CONFIGURATION.get(‘micrositeSolution.domainName’)}`
}));
$(‘head’).append(jsonLdScript);
});
}
}
2. Update Meta Tags Dynamically
Also inside your getJsonLd() method:
let siteName = SC.CONFIGURATION.get(“micrositeSolution.siteName”);
$(“head meta[property=’og:site_name’], head meta[property=’og:provider_name’]”).each(function () {
$(this).attr(“content”, siteName);
});
3. Product Structured Data: JSON-LD
Enhance the product schema with domain-accurate metadata.
getJsonLd: function getJsonLd(childJsonLd) {
if (SC.CONFIGURATION.get(“structureddatamarkup.type”) !== “JSON-LD”) {
return jQuery.Deferred().resolve(null);
}
const priceContainer = this.model.getPrice();
const isPriceRange = priceContainer.min && priceContainer.max;
const modelItem = this.model.get(‘item’);
const stockInfo = this.model.getStockInfo();
const offers = {
‘@type’: ‘Offer’,
url: modelItem.get(‘_url’),
availability: ‘http://schema.org/OutOfStock‘
};
if (stockInfo.isPurchasable && !stockInfo.isInStock) {
offers.availability = Configuration.get(‘structureddatamarkup.availabilityonbackorder’) === ‘PreOrder’
? ‘http://schema.org/PreOrder‘
: ‘http://schema.org/InStock‘;
} else if (stockInfo.isInStock) {
offers.availability = ‘http://schema.org/InStock‘;
}
if (!ProfileModel.getInstance().hidePrices()) {
if (isPriceRange) {
offers.priceSpecification = {
‘@type’: ‘PriceSpecification’,
price: priceContainer.price,
minPrice: priceContainer.min.price,
maxPrice: priceContainer.max.price
};
} else {
offers.price = priceContainer.price;
}
offers.priceCurrency = SC.getSessionInfo(‘currency’)?.code
|| Configuration.get(‘siteSettings.shopperCurrency.code’);
}
const description = jQuery(`<div>${modelItem.attributes.storedetaileddescription}</div>`).text();
const jsonld = {
‘@type’: ‘Product’,
name: this.page_header,
image: this.model.getImages()[0]?.url.toString(),
offers,
description: description || undefined,
sku: this.model.getSku() || undefined,
…childJsonLd
};
delete jsonld[‘@type’];
return jQuery.Deferred().resolve(jsonld);
}
