How to add structured data (3.2)
Structured data is a small block of code in a page that tells Google, in a fixed format, facts a person reads off the page: "this is a business at this address", "this is a video, posted on this date". Card 3.2 asks for four kinds: Organization, LocalBusiness, VideoObject and FAQ. Plan: 3.2-structured-data.md.
BlueBoost writes the code for you. Placing it on the site is a fix-list step, done by whoever edits the website.
1. Get the code
cd db && npm run schema
It takes about 5 minutes and writes a folder out/schema-<site>-<time>/:
- one
.htmlfile per page, named after the page's address (index.htmlis the home page/,home.htmlis the separate/homepage,blog--my-post.htmlis/blog/my-post). Each holds the code to paste into that page. report.json: what each page carries now, and why any video was skipped.
Run it again after changing a fact or adding a video, and use the newest folder.
2. Check the business facts first
Organization and LocalBusiness are built from db/config/business-blueforest.json: name, address, phone, email, hours, logo, social profiles. Google may show these, so a wrong phone number here is a wrong phone number in search. Correct the file, not the pasted code, and change facts_version.
3. Place it
The code goes in the page's <head> (it also works in the body). Every website platform has a place for this, usually called "code injection", "custom code" or "head code", per page.
| Code | Where | When |
|---|---|---|
| VideoObject (in each page's file) | That page | Now, on any platform |
Organization and LocalBusiness (in index.html) | Home page only | After the move off Squarespace. Squarespace already adds its own copies to every page; adding ours beside them gives Google two versions that disagree. On the new platform, make sure it doesn't add its own, then paste ours |
| FAQ | The pages 5.2 names | After 5.2 writes the questions and answers |
4. Check it worked
- Paste one page's address into Google's Rich Results Test. It should find the video (or the business) and report no errors.
- Run
npm run schemaagain. That page's checks should now say "present". - The next audit (
npm run audit) stops counting that page in the VideoObject fix.