Skip to content
12
DAYS
12
HOURS
12
MINUTES
12
SECONDS
"Transform your skincare routine with Tatcha’s exquisite products. Inspired by timeless Japanese beauty rituals, this collection delivers radiant, hydrated, and youthful skin."
",
};
break;
case "blog":
structuredData = {
"@context": "https://schema.org/",
"@type": "BlogPosting",
headline: "",
author: {
"@type": "Person",
name: "",
},
datePublished: "",
description: "",
};
break;
default:
structuredData = {
"@context": "https://schema.org/",
"@type": "WebPage",
name: "Tatcha: The Art of Japanese Skincare",
description: ""Transform your skincare routine with Tatcha’s exquisite products. Inspired by timeless Japanese beauty rituals, this collection delivers radiant, hydrated, and youthful skin."",
};
break;
}
async function appendNoFollow() {
const metaTag = document.createElement("meta");
metaTag.name = "robots";
metaTag.content = "nofollow";
document.head.appendChild(metaTag);
}
async function appendNoIndex() {
const metaTag = document.createElement("meta");
metaTag.name = "robots";
metaTag.content = "noindex";
document.head.appendChild(metaTag);
}
async function getStoreDetailSeoApp() {
const res = await fetch(
`${wtSeoAppUrl}api/store-front/store-details?shop=${wtSeoShopName}`,
{ headers: { "Content-Type": "application/json" } }
);
const jsonData = await res.json();
if (jsonData?.isPaidUser) {
appendMissingAltTexts();
appendMetaData()
}
if (wtSeoTemplateName == "product") {
if (jsonData?.nofollowAllProdFlag) {
appendNoFollow();
} else {
const selectedProds = jsonData?.nofollowSelectedProducts;
const index = selectedProds.findIndex((x) => x._id == meta.product.id);
if (index > -1) {
appendNoFollow();
}
}
if (jsonData?.noindexAllProdFlag) {
appendNoIndex();
} else {
const selectedProds = jsonData?.noindexSelectedProducts;
const index = selectedProds.findIndex((x) => x._id == meta.product.id);
if (index > -1) {
appendNoIndex();
}
}
} else if (wtSeoTemplateName == "collection") {
if (jsonData?.nofollowAllCollFlag) {
appendNoFollow();
} else {
const selectedProds = jsonData?.nofollowSelectedCollection;
const index = selectedProds.findIndex(
(x) => x._id == meta.page.resourceId
);
if (index > -1) {
appendNoFollow();
}
}
if (jsonData?.noindexAllCollFlag) {
appendNoIndex();
} else {
const selectedProds = jsonData?.noindexSelectedCollection;
const index = selectedProds.findIndex(
(x) => x._id == meta.page.resourceId
);
if (index > -1) {
appendNoIndex();
}
}
} else if (wtSeoTemplateName == "page") {
if (jsonData?.nofollowAllPagesFlag) {
appendNoFollow();
} else {
const selectedProds = jsonData?.nofollowSelectedPages;
const index = selectedProds.findIndex(
(x) => x._id == meta.page.resourceId
);
if (index > -1) {
appendNoFollow();
}
}
if (jsonData?.noindexAllPagesFlag) {
appendNoIndex();
} else {
const selectedProds = jsonData?.noindexSelectedPages;
const index = selectedProds.findIndex(
(x) => x._id == meta.page.resourceId
);
if (index > -1) {
appendNoIndex();
}
}
} else if (wtSeoTemplateName == "blog") {
if (jsonData?.nofollowAllBlogsFlag) {
appendNoFollow();
} else {
const selectedProds = jsonData?.nofollowSelectedBlogs;
const index = selectedProds.findIndex(
(x) => x._id == meta.page.resourceId
);
if (index > -1) {
appendNoFollow();
}
}
if (jsonData?.noindexAllBlogsFlag) {
appendNoIndex();
} else {
const selectedProds = jsonData?.noindexSelectedBlogs;
const index = selectedProds.findIndex(
(x) => x._id == meta.page.resourceId
);
if (index > -1) {
appendNoIndex();
}
}
}
if (jsonData?.googleStructuredData && jsonData?.isPaidUser) {
// Check the type of structured data to append
if (jsonData.checkedStructuredDataType === "site-wide") {
appendStructuredData(structuredData);
} else if (jsonData.checkedStructuredDataType === "custom") {
let shouldAppend = false;
switch (wtSeoTemplateName) {
case "index":
shouldAppend = jsonData.checkedStructuredDataHomePage;
break;
case "collection":
shouldAppend = jsonData.checkedStructuredDataCollPage;
break;
case "product":
shouldAppend = jsonData.checkedStructuredDataProductPage;
break;
case "list-collections":
shouldAppend = jsonData.checkedStructuredDataCollListPage;
break;
case "blog":
shouldAppend = jsonData.checkedStructuredDataBlogPage;
break;
default:
shouldAppend = jsonData.checkedStructuredDataCustomPage;
break;
}
if (shouldAppend) {
appendStructuredData(structuredData);
}
}
}
}
getStoreDetailSeoApp();
});