The search world is all about social graphing today. Just look at Google's quick results sidebar when you search for a local business. You see a picture of the business, rating/reviews, hours, menu and more. Structured SEO data can help you define and shape what is shown about your site on search results.
This talks is intended to help people understand how to apply Structured data to a website and then implement this with a minimum of technical skill.
This talk covers:
Why you should be using structured data
An overview of what structured data is
A dive into the Schema.org standard and how Search Engines expect this to be embedded into a site.
A short example of how this was used in the DukeHealth.org site
A how to on using the Metatag and Schema.org Metatag modules to add structured data to your site.
A very quick look at how to go beyond what these can do using code.
Note I'm not an SEO wiz that can tell you 'how to make your site shine' but have learned a bit while implementing this on various sites. In other words, I may not be able to tell you what to do for this, but I can tell you how to do it. :)
1. Structured SEO Data:Structured SEO Data:
An overview and how to for DrupalAn overview and how to for Drupal
Greg Monroe
SolarWinds MSP
Drupal Camp Atlanta 2019
The information here is my own and not the views of my employer
Json Voordrop
2. Why Use Structured Data?
Improved SEO results because it lets Search Engines understand your
content better
Enhanced display of your content in search results such as:
Site Information
Knowledge graphs
Product panels
Rich snippets
Use by aggregating sites
Better Social Sharing
Higher click thru rates and conversions
7. How did they do these?
Search Engine magic sauce…
Social Graphing… who you are, where you are, what you
are/have search(ing/ed) for.
Context specific results pages
Use site specific structured data to find and build the results.
8. Structured Data Definition
Web pages are often filled with free form text, which is easy for
humans to read but more difficult for computers to understand.
Structured data formats are rules that standardize the structure
and content of a web page. They are additional markup that lets
computers more easily process the text meaning or semantics.
9. Structured Data
A Fractured Fairy Tale History
In the beginning… HTML metadata definitions:
title, description, keywords
The Babel Period: RSS, RDF, RDFa, Open Graph,
vCard/hCard, hCalendar, FOAF, Twitter Cards, and
the like.
Unified Field Theory – Schema.org
10. Schema.org
Schema.org is a collaborative, community activity with a
mission to create, maintain, and promote schemas for
structured data on the Internet.
The Schema.org vocabulary can be used with many different
encodings, including RDFa, Microdata and JSON-LD.
These vocabularies cover entities, relationships between
entities and actions, and can easily be extended through a
well-documented extension model.
See: http://www.schema.org/
11. Schemas
Schemas are a set of 'types' or classes, e.g. Organization
These types are arranged in a hierarchy. E.g. Organization is
derived from Thing and has multiple subtypes like
EducationalOrganization, Corporation, LocalBusiness, and more.
Each type has a set of properties, e.g. Organization has a name
property
Types inherit properties from the type above them.
13. Type Properties Sample
Has 112 properties
Each has an expected type
the property takes.
Some properties can
reference other types.
14. Embedding Schema Information
Three choice:
Microdata – Requires span tags and special attributes to be
embedded in HTML
RDFa – Similar to Microdata but requires different attributes inside
the HTML
JSON-LD – Google’s preferred method. Information is added in
JSON format in the HTML as script tags of type application/ld+json
16. Linking Objects with
JSON-LD Node Identifiers
@type: Organization
@id: http://my.org/#org
@type: Website
@id: http://my.org/#web
Publisher: {
@type: Organization,
@id: http://my.org/#org
}
InLanguage: en
WorkTranslation: {
@id: http://my.org/de#web
}
@type: Website
@id: http://my.org/de#web
Publisher: {
@type: Organization,
@id: http://my.org/#org
}
InLanguage: de
TranslationOfWork: {
@id: http://my.org/#web
}
See: https://www.w3.org/TR/2014/REC-json-ld-20140116/#node-identifiers
Note: The @id URI can be anywhere on the web, they just have to match.
17. Quick Case Study: Duke Health
Home Page
Organization
WebSite
Doctor Pages
Physician
AggregateRating
Clinic Pages
MedicalClinic
Person
Hospital Pages
Hospital
Doctor Search
AggregateRating
Blog Articles
Og:title, og:type,
Og:description,
Og:url, og:image,
Og:site_name
Event Pages
Event
Place
Notes:
●
Uses microdata
embedding (ld-json
was too new at the
time)
●
Blended Drupal /
AngularJS site so
most info built into
Angular code and
templates.
18. Structured Data in Drupal
MetaTag module with Schema.org Metatag FTW!
(drupal.org/project/metatag & drupal.org/project/schema_metatag)
Supports all the major structured data standards, including the a
growing group of Schema.org types
Global defaults based on Tags per content type
Allows for individual pages to be customized
I18N Support
Views support
19. A Quick Setup Guide
Add and enable the MetaTag module to your site
Recommended Submodules to enable:
Metatag: Open Graph
Metatag: Views
Schema.org Metatag
Schema.org Website
Schema.org Organization
Any other Schema type you think you will need.
20. A Quick Setup Guide (cont)
Go to Admin Configuration Search and Metadata→ Configuration → Search and Metadata → → Configuration → Search and Metadata → → Configuration → Search and Metadata →
Metatag
Adjust the global and entity defaults.
To allow individual entities to be managed:
Go to the entity’s Manage Fields page (Structure Content Types)→ Configuration → Search and Metadata →
Add a new field using the Meta Tags type.
If you are using translations, select “User may translate this field”
21. Metatag Defaults Structure
Global Default
General Categories (Front page, content, taxonomy, etc)
Per Entity Type
– Per Entity
Meta information can be easily ‘automated’ using MetaTags trickle
down defaults and tags referencing entity information
33. Some Things to Know
The Schema Metatags modules add a large number of fields to
the edit forms… only use what you need.
Translation linkage properties are only available in the dev
version (Issue #3034233)
Don’t overuse common types like Organization / Website. These
should be on a few pages like the home page or “About” pages.
34. Adding data via Code
Use the hook:
page_attachments_alter()
Add your JSON encoded
information to the
$attachments parameter.
$attachments['#attached']['html_head']
['my_custom_schema'] = [
[
'#type' => 'html_tag',
'#tag' => "script",
'#value' => theme_build_schema_elements(),
'#attributes' => [
'type' => 'application/ld+json',
],
],
];
35. Drupal Camp Atlanta 2019
Questions?
?And Thank You
Google: Slideshare CGMonroe Stuctured Data
Drupal.org/u/cgmonroe