Passa al contenuto principale

How to Add JSON-LD Structured Data (Schema.org) to Your ShopFactory Website via Template Editing - Knowledgebase / Getting Started - ShopFactory Help Center

How to Add JSON-LD Structured Data (Schema.org) to Your ShopFactory Website via Template Editing

Elenco degli autori

Overview

JSON-LD (JavaScript Object Notation for Linked Data) is a structured data format that helps search engines (Google, Bing) and AI engines (ChatGPT, Claude, Perplexity, Gemini) understand your website content. Adding JSON-LD to your shop can result in rich snippets in search results, Knowledge Panel visibility, and increased chances of being recommended by AI-powered search tools.

This article explains how to add JSON-LD structured data - such as Organization schema - to your ShopFactory website by editing the website template file. This method places the code in the <head> section of every page on your site, making it ideal for site-wide structured data like your company information.

Good to Know: Products Are Already Covered

ShopFactory automatically generates JSON-LD Product schema for all your product pages. This includes product name, SKU, EAN/GTIN, description, price, currency, availability, seller information, and product image. You do not need to add Product structured data manually - it's already there.

You can verify this by testing any of your product page URLs at Google's Rich Results Test. You should see "Product snippets" and "Merchant listings" detected as valid items.

Why Edit the Template File?

ShopFactory's built-in Custom Content areas and the Global Custom HTML Head area wrap <script> tags with a JavaScript protection layer (SFNOTE) that prevents script execution in editing mode. While this is useful for regular JavaScript, it breaks JSON-LD because application/ld+json script tags must contain pure JSON - no JavaScript, no comments.

Editing the template file directly bypasses this issue entirely, placing clean JSON-LD code in the <head> section of your pages.

Important: Back Up First

Before making any changes, create a backup of the template file. Copy the entire template folder to a safe location so you can restore it if needed.

Step-by-Step Instructions

Step 1: Locate the Template File

Navigate to the following folder on your computer:

C:\ShopFactory\ShopFactory V14 Websites\[your website project folder]\SFXTemplates\Themes\[your template folder name]\Website\parseLang

Replace [your website project folder] with the name of your website project and [your template folder name] with the name of the template/theme you are using.

Step 2: Open the File

Open the file website.html with Notepad (or any plain text editor). Do not use a word processor like Microsoft Word.

Step 3: Find the Insertion Point

Search for the following line in the file:

<!-- Metatags inserted above here by the EnablePage macro above if use_default_metatags="true" -->

Step 4: Insert Your JSON-LD Code

Directly after that line, paste your JSON-LD code. See the examples below for common schema types.

Step 5: Save and Publish

Save the file in Notepad, then open your website in ShopFactory and publish it as usual.

Step 6: Validate

After publishing, test your website URL at Google's Rich Results Test to confirm the structured data is detected and valid.

Example: Organization Schema

The Organization schema tells search engines and AI who you are as a business. This is the most important schema to add first, especially for GEO (Generative Engine Optimization).

Replace all placeholder values (marked with YOUR) with your actual business details:

<script type="application/ld+json">

{

"@context": "https://schema.org",

"@type": "Organization",

"name": "YOUR BUSINESS NAME",

"url": "https://www.YOUR-DOMAIN.com",

"logo": "https://www.YOUR-DOMAIN.com/contents/media/YOUR-LOGO-FILENAME.png",

"description": "YOUR BUSINESS DESCRIPTION",

"address": {

"@type": "PostalAddress",

"streetAddress": "YOUR STREET ADDRESS",

"addressLocality": "YOUR CITY",

"addressRegion": "YOUR REGION",

"postalCode": "YOUR POSTAL CODE",

"addressCountry": "YOUR COUNTRY CODE"

},

"contactPoint": {

"@type": "ContactPoint",

"telephone": "YOUR PHONE NUMBER",

"contactType": "Customer Service",

"email": "YOUR EMAIL ADDRESS"

}

}

</script>

Country Codes

Use the two-letter ISO country code for addressCountry. Common examples: US (United States), CA (Canada), NL (Netherlands), DE (Germany), GB (United Kingdom), FR (France), IL (Israel), AU (Australia).

Example: Organization Schema with Extended Fields

For businesses that want to provide more detail to AI engines, you can include additional fields like areas served, expertise, and social media links:

<script type="application/ld+json">

{

"@context": "https://schema.org",

"@type": "Organization",

"name": "YOUR BUSINESS NAME",

"alternateName": "YOUR ALTERNATE NAME",

"url": "https://www.YOUR-DOMAIN.com",

"logo": "https://www.YOUR-DOMAIN.com/contents/media/YOUR-LOGO-FILENAME.png",

"description": "YOUR BUSINESS DESCRIPTION",

"foundingDate": "YOUR FOUNDING YEAR",

"address": {

"@type": "PostalAddress",

"streetAddress": "YOUR STREET ADDRESS",

"addressLocality": "YOUR CITY",

"addressRegion": "YOUR REGION",

"postalCode": "YOUR POSTAL CODE",

"addressCountry": "YOUR COUNTRY CODE"

},

"contactPoint": {

"@type": "ContactPoint",

"telephone": "YOUR PHONE NUMBER",

"contactType": "Customer Service",

"email": "YOUR EMAIL ADDRESS",

"availableLanguage": ["English"]

},

"areaServed": [

{ "@type": "Country", "name": "YOUR COUNTRY" }

],

"knowsAbout": [

"YOUR EXPERTISE TOPIC 1",

"YOUR EXPERTISE TOPIC 2",

"YOUR EXPERTISE TOPIC 3"

],

"sameAs": [

"https://www.facebook.com/YOUR-PAGE",

"https://www.linkedin.com/company/YOUR-COMPANY"

]

}

</script>

Important Notes

  • Use straight quotes only. JSON requires straight double quotes ("). Do not use curly/smart quotes. Notepad uses straight quotes by default, which is why we recommend it for editing.

  • Replace ALL placeholders. Do not leave any "YOUR..." values in the code. Remove any fields you don't have information for rather than leaving placeholders.

  • Do not use ShopFactory's Custom Content areas for JSON-LD. These areas wrap script tags with SFNOTE protection that breaks the JSON format. Always use the template file method described above.

  • One Organization schema is enough. Since the template file applies to all pages, your Organization schema will appear on every page of your website. This is normal and expected.

  • Template updates may overwrite your changes. If you change your ShopFactory template/theme or update to a new version, you may need to re-add the JSON-LD code. Keep a backup of the code you added.

  • Validate after every change. Always test at Google's Rich Results Test after publishing to make sure your structured data is valid. A single missing comma or mismatched quote can break the entire JSON block.

Troubleshooting

The Rich Results Test shows "Unparsable structured data" This usually means there is a syntax error in your JSON. Common causes: missing comma between fields, trailing comma after the last field, use of smart/curly quotes instead of straight quotes, or unescaped special characters. Paste your JSON-LD code (just the part between the <script> tags) into JSONLint to find the exact error.

The Rich Results Test doesn't detect any structured data Make sure you saved the file, published the website, and that you're testing the correct URL. Also verify the code is placed after the correct comment line in the template file.

The structured data appears but shows warnings Non-critical warnings (shown with an orange icon) are suggestions for optional fields like logo, telephone, or aggregateRating. These are recommendations, not errors - your structured data is still valid and will work.

What About FAQ Schema?

For FAQ structured data, we recommend using the microdata method via ShopFactory's text block editor instead of the template file approach. This allows you to add page-specific and product-specific FAQs without template editing. See our separate article: How to Add FAQ Structured Data (Schema.org) to Your ShopFactory Pages and Products.