课程信息(CourseCourseInstance)结构化数据

图示:课程信息在 Google 搜索中的可能显示效果

您可以使用课程信息结构化数据向 Google 说明您的课程,帮助用户找到您的课程内容。如果您提供有关课程的更多详细信息(例如评价者评分、定价和课程详情),Google 可以更好地了解您的课程,并通过课程信息富媒体搜索结果向用户提供丰富的体验。

以下介绍两项课程富媒体搜索结果功能,它们使用了相同的 schema.org Course 类型。如果您的网站提供课程相关信息,您便可以按照以下两个实现指南来使用这两项功能:

  • 课程列表:一种富媒体搜索结果,会列出来自同一网站上的课程。
  • 课程信息:一个轮播界面,会显示来自多个网站的详细课程信息。

功能可用性

在所有可以使用 Google 搜索的区域,课程信息富媒体搜索结果均以英语提供。我们希望将来能支持更多非英语课程。

如何添加结构化数据

结构化数据是一种提供网页相关信息并对网页内容进行分类的标准化格式。如果您不熟悉结构化数据,可以详细了解结构化数据的运作方式

下面概述了如何构建、测试和发布结构化数据。如需获得向网页添加结构化数据的分步指南,请查看结构化数据 Codelab

  1. 添加必要属性。根据您使用的格式,了解在网页上的什么位置插入结构化数据
  2. 遵循指南
  3. 使用富媒体搜索结果测试验证您的代码,并修复所有严重错误。此外,您还可以考虑修正该工具中可能会标记的任何非严重问题,因为这些这样有助于提升结构化数据的质量(不过,要使内容能够显示为富媒体搜索结果,并非必须这么做)。
  4. 部署一些包含您的结构化数据的网页,然后使用网址检查工具测试 Google 看到的网页样貌。请确保您的网页可供 Google 访问,不会因 robots.txt 文件、noindex 标记或登录要求而被屏蔽。如果网页看起来没有问题,您可以请求 Google 重新抓取您的网址
  5. 为了让 Google 随时了解日后发生的更改,我们建议您提交站点地图Search Console Sitemap API 可以帮助您自动执行此操作。

示例

下面是单个课程信息页面的示例。


<html>
  <head>
    <title>Introduction to Computer Science and Programming</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org/",
      "@id": "https://www.example.com/advancedCpp",
      "@type": "Course",
      "name": "Learn Advanced C++ Topics",
      "description": "Improve your C++ skills by learning advanced topics.",
      "publisher": {
        "@type": "Organization",
        "name": "CourseWebsite",
        "url": "www.examplecoursewebsite.com"
      },
      "provider": {
        "@type": "Organization",
        "name": "Example University",
        "url": "www.example.com"
      },
      "image": [
        "https://example.com/photos/1x1/photo.jpg",
        "https://example.com/photos/4x3/photo.jpg",
        "https://example.com/photos/16x9/photo.jpg"
      ],
      "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": 4,
        "ratingCount": 1234,
        "reviewCount": 450
      },
      "offers": [{
        "@type": "Offer",
        "category": "Paid",
        "priceCurrency": "EUR",
        "price": 10.99
      }],
      "totalHistoricalEnrollment": 12345,
      "datePublished": "2024-03-21",
      "educationalLevel": "Advanced",
      "about": ["C++ Coding", "Backend Engineering"],
      "teaches": ["Practice and apply systems thinking to plan for change",
                  "Understand how memory allocation works."],
      "financialAidEligible": "Scholarship Available",
      "inLanguage": "en",
      "availableLanguage": ["fr", "es"],
      "syllabusSections": [
        {
          "@type": "Syllabus",
          "name": "Memory Allocation",
          "description": "Learn how memory is allocated when creating C++ variables.",
          "timeRequired": "PT6H"
        },
        {
          "@type": "Syllabus",
          "name": "C++ Pointers",
          "description": "Learn what a C++ pointer is and when they are used.",
          "timeRequired": "PT11H"
        }
      ],
      "review": [
      {
        "@type": "Review",
        "author": {
            "@type": "Person",
            "name": "Lou S."
        },
        "datePublished": "2024-08-31",
        "reviewRating": {
          "@type": "Rating",
          "bestRating": 10,
          "ratingValue": 6
        }
      }],
      "coursePrerequisites": [
        "Basic understanding of C++ up to arrays and functions.",
        "https://www.example.com/beginnerCpp"
      ],
      "educationalCredentialAwarded": [{
        "@type": "EducationalOccupationalCredential",
        "name": "CourseProvider Certificate",
        "url": "www.example.com",
        "credentialCategory": "Certificate",
        // offers only needed if the credential costs extra money.
        "offers": [{
          "@type": "Offer",
          "category": "Paid",
          "price": 5,
          "priceCurrency": "USD"
        }]
      }],
      "video": {
        "@type": "VideoObject",
        "name": "Video name",
        "description": "A video previewing this course.",
        "uploadDate": "2024-03-28T08:00:00+08:00",
        "contentUrl": "www.example.come/mp4",
        "thumbnailUrl": "www.example.com/thumbnailurl.jpg"
      },
      "hasCourseInstance": [
      {
        // Blended, instructor-led course meeting 3 hours per day in July.
        "@type": "CourseInstance",
        "courseMode": "Blended",
        "location": "Example University",
        "courseSchedule": {
          "@type": "Schedule",
          "duration": "PT3H",
          "repeatFrequency": "Daily",
          "repeatCount": 31,
          "startDate": "2024-07-01",
          "endDate": "2024-07-31"
        },
        "instructor": [{
          "@type": "Person",
          "name": "Ira D.",
          "description": "Professor at X-University",
          "image": "http://example.com/person.jpg"
        }]
      },
      {
        // Online self-paced course that takes 2 days to complete.
        "@type": "CourseInstance",
        "courseMode": "Online",
        "courseWorkload": "P2D"
      }],
      // Only required for course programs that link to child courses.
      "hasPart": [{
        "@type": "Course",
        "name": "C++ Algorithms",
        "url": "https://www.example.com/cpp-algorithms",
        "description": "Learn how to code base algorithms in c++.",
        "provider": {
          "@type": "Organization",
          "name": "Example University",
          "url": "www.example.com"
        }
      }, {
        "@type": "Course",
        "name": "C++ Data Structures",
        "url": "https://www.example.com/cpp-data-structures",
        "description": "Learn about core c++ data structures.",
        "provider": {
          "@type": "Organization",
          "name": "Example University",
          "url": "www.example.com"
        }
      }]
    }
    </script>
  </head>
  <body>
  </body>
</html>

指南

您的课程必须遵循以下指南,才能符合条件在 Google 搜索中显示为课程信息富媒体搜索结果。

内容指南

只有符合下述课程定义的教育内容才可显示为课程信息富媒体搜索结果:围绕特定主题或话题展开,且包含讲座、课程或模块的课程系列或单元。

Course 标记必须位于提供完整的单个课程课程计划的网页上。以下示例不符合显示为课程信息富媒体搜索结果的条件:

  • 学位摘要页面
  • 单独的考试页面
  • 诸如“天文日”之类的一般公众活动
  • 一个 2 分钟的“如何制作三明治”视频

结构化数据类型定义

若要使您的内容能够在 Google 搜索中显示为富媒体搜索结果,您必须为其添加必需属性 CourseCourseInstance。您还可添加建议属性,以便加入与内容相关的更多信息,进而提供更优质的用户体验。

Course

课程是单个课程单元,可以单独学习,也可以作为课程计划的一部分学习。

如需了解 Course 的完整定义,请访问 schema.org/Course

必需的属性
name

Text

课程的完整标题。

"name": "Intro to Statistics"
description

Text

课程的说明。

  • 建议长度:240 个字符
  • 长度上限:500 个字符
"description": "This course teaches the basics of statistical thinking."
provider

Organization

制作了课程内容的组织的相关信息。

"provider": {
   "@type": "Organization",
   "name": "Example University",
   "url": "www.exampleuniversity.com"
}
provider.name Text

课程提供方的名称。

offers

可重复的 Offer

学完课程所需的总价(包括服务费)的相关信息。不要列出仅适用于某些用户的价格(例如,初次使用的用户可享受八折优惠)。

请勿在此字段中包含额外的证书费用。如果获取证书需要额外付费,请将相应费用添加到 educationalCredentialAwarded 属性中。

"offers": [{
   "@type": "Offer",
   "category": "Paid",
   "priceCurrency": "EUR",
   "price": 10.99
}]
         
offers.category Text

课程的定价类别。请使用以下某个值:

  • Free:所有讲座、作业和测试都必须免费向所有用户提供。整个课程可免费学完。
  • Partially Free:课程半数以上内容都可以免费学完(例如,所有讲座都是免费的,但作业需要付费)。
  • Subscription:用户必须是订阅者或付费会员才能学完整个课程。
  • Paid:用户必须付费才能学完课程。
hasCourseInstance

可重复的 CourseInstance

每门课程都必须至少有一个课程实例,其中详细说明课程内容。请查看 CourseInstance 部分中的必需属性和建议属性。

"hasCourseInstance": [{
   // Onsite, instructor-led class meeting weekly in August 2023
   "@type": "CourseInstance",
   "courseMode": "Onsite",
   "location": "Example University",
   "courseSchedule": {
      "@type": "Schedule",
      "duration": "PT5H",
      "repeatCount": 4,
      "repeatFrequency": "Weekly",
      "startDate": "2023-08-01",
      "endDate": "2023-8-31"
   },
   "instructor": [{
      "@type": "Person",
      "name": "Kai S.",
      "description": "Professor at X-University",
      "image": "http://examplePerson.jpg"
   }]
}]
建议的属性
about

可重复的 Text

描述用户在学习课程后将会掌握的技能(如果适用)。

"about": ["Quantitative Analysis", "Critical Thinking"]
aggregateRating

AggregateRating

课程平均评分的相关信息,根据学过该课程的用户给出的评分得出(如果适用)。请遵循评价摘要指南以及必需和建议的 AggregateRating 属性的列表。

"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": 4.8,
"ratingCount": 255,
"reviewCount": 189
}
availableLanguage

可重复的 Text

课程提供的字幕或其他语言版本(如果适用)。使用 ISO 639-1 alpha-2 代码列表中由两个字母组成的代码。

"availableLanguage": ["fr", "es", "de"]
coursePrerequisites

可重复的 Text

课程所需的任何先前知识(如果适用)。这可以通过描述先前的知识和/或链接到其他课程来表示。

"coursePrerequisites": ["Understanding of Algebra concepts like variables and functions",
            "https://www.coursewebsite.abc/algebra"]
datePublished

Date

课程首次发布的日期(如果适用)。请使用 8601 日期格式 (YYYY-MM-DD)。

"datePublished": "2019-03-21"
educationalCredentialAwarded

可重复的 EducationalOccupationalCredential

用户学完课程后可获得的证书或凭证的相关信息(如果适用)。如果奖项需要额外付费,请指明额外价格。

"educationalCredentialAwarded": [{
   "@type": "EducationalOccupationalCredential",
   "name": "CourseProvider Certificate",
   "url": "www.examplecertificate.com",
   "credentialCategory": "Certificate",
   "offers": [{
      "@type": "Offer",
      "category": "Paid",
      "priceCurrency": "USD",
      "price": 5
   }]
}]
educationalCredentialAwarded.credentialCategory Text

用户将获得的奖项类型(如果适用)。请使用以下某个值:

  • Certificate:用于证明用户成功完成课程或计划的奖项。
  • Certification:必须通过考试或证明用户达到相应能力才可获得的官方凭证。

educationalCredentialAwarded.name Text

奖项的名称(如果适用)。

educationalCredentialAwarded.offers.category Text

奖项的定价类型(如果适用)。请使用以下某个类别:

  • Free:免费提供奖项。
  • Subscription:用户必须是订阅者或付费会员才能获得奖项。
  • Paid:用户必须付费才能获得奖项。
educationalCredentialAwarded.offers.price Number

奖项的数值价格(如果适用)。

educationalCredentialAwarded.offers.priceCurrency Text

奖项价格的币种,采用 ISO 4217 货币格式(由 3 个字母组成的代码,如果适用)。

educationalCredentialAwarded.url URL

指向奖项页面的链接(如果适用)。

educationalLevel

Text

课程的目标教育水平(如果适用)。可以选择以下某个值。

  • Beginner:无需事先了解即可理解相应内容
  • Intermediate:您可能需要具备一些知识,才能理解相应内容
  • Advanced:该内容面向具备此主题相关的先验知识的高级学习者
"educationalLevel": "Beginner"
financialAidEligible

Text

向想学习该课程的用户提供的任何奖学金、特殊付款方案或其他财务资助机会(如果适用)。

"financialAidEligible": "Scholarships available for eligible users."
image

可重复的 URL

指向代表该课程的图片的网址(如果适用)。请使用与课程相关的图片,而不是徽标或图片说明。

其他的图片指南:

  • 图片网址必须可抓取且可编入索引。如需检查 Google 能否访问您的网址,请使用网址检查工具
  • 图片必须代表标记的内容。
  • 图片必须采用受 Google 图片支持的文件格式。
  • 为取得最佳效果,建议您提供具有以下宽高比的多个高分辨率图片(宽度乘以高度至少为 50K 像素):16x9、4x3 和 1x1。

例如:

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
inLanguage

Text

课程使用的主要语言(如果适用)。使用 ISO 639-1 alpha-2 代码列表中由两个字母组成的代码。

"inLanguage": "en"
offers.price Number

课程的数值价格(如果适用)。请勿在此字段中包含其他信息,例如货币符号。

offers.priceCurrency Text

课程价格的币种,采用 ISO 4217 货币格式(由 3 个字母组成的代码,如果适用)。

provider.url URL

链接到课程提供方首页的网址(如果适用)。

publisher

Organization

发布和展示该课程的组织的相关信息(如果适用)。

"publisher": {
   "@type": "Organization",
   "name": "Course Website",
   "url": "www.example.com"
}
publisher.name Text

课程发布方的名称(如果适用)。

publisher.url URL

链接到课程发布方首页的网址(如果适用)。

review

可重复的 Review

课程的用户评价列表(如果适用)。如需了解详情,请参阅评价摘要指南

"review": [{
   "@type": "Review",
   "author": {
      "@type": "Person",
      "name": "Sasha J."
   },
   "datePublished": "2021-09-22",
   "reviewRating": {
      "@type": "Rating",
      "ratingValue": 4
   }
}]
syllabusSections

可重复的 Syllabus

课程中不同模块的相关信息(如果适用)。

"syllabusSections": [{
   "@type": "Syllabus",
   "name": "Algebra Review",
   "description": "Review prerequisite Algebra concepts.",
   "timeRequired": "PT2H30M"
}, {
   "@type": "Syllabus",
   "name": "Statistics Terms",
   "description": "Learn the definitions of basic statistics terms.",
   "timeRequired": "PT5H"
}]
syllabusSections.description Text

模块内容的说明(如果适用)。

syllabusSections.name Text

课程模块的名称(如果适用)。

syllabusSections.timeRequired Duration

使用 8601 时长格式(如果适用)。例如,PT2H30M 表示该模块需要 2 小时 30 分钟才能全部完成。

teaches

可重复的 Text

学习课程后用户将取得的学习成果或学到的特定知识(如果适用)。

"teaches": ["How to use visualization tools and graphs", "Why stats is important"]
totalHistoricalEnrollment

Integer

在整个课程有效期内注册的用户总数(如果适用)。

"totalHistoricalEnrollment": 80032
video

VideoObject

课程的视频预览或预告片(如果适用)。如需了解详情,请参阅 VideoObject 指南

"video": {
   "@type": "VideoObject",
   "name": "Video name",
   "description": "A video previewing this course.",
   "uploadDate": "2022-03-28T08:00:00+08:00",
   "contentUrl": "www.videourl.mp4",
   "thumbnailUrl": "www.thumbnailurl.jpg"
}

CourseInstance

如需了解 CourseInstance 的完整定义,请访问 schema.org/CourseInstance。每门课程都必须至少有一个 CourseInstance,并且必需的属性已填写。

必需的属性
courseMode

Text

用于提供课程的媒介。请使用以下某个值:

  • Online:所有课堂讲座、作业和测试都可以通过线上方式完成。
  • Onsite:课程会在实际地点面对面教学。
  • Blended:课程包含线上和线下授课内容。

如果课程为 OnsiteBlended,请添加 location 属性。

"courseMode": "Online"

courseSchedule

Schedule

提供建议的进度,说明一般用户学完课程所需的时间。对于时间安排固定的课程,请添加开始日期和结束日期。

以下是一个可随时开始的按进度课程的示例:

// This course takes 6 weeks to complete.
"courseSchedule": {
   "@type": "Schedule",
   "repeatCount": 6
   "repeatFrequency": "Weekly",
}

以下是一个在设定期限内学习的按进度课程的示例:

// This course expects 1 hour per day during July 2023
"courseSchedule": {
   "@type": "Schedule",
   "duration": "PT1H",
   "repeatCount": 31
   "repeatFrequency": "Daily",
   "startDate": "2023-07-01",
   "endDate": "2023-07-31"
}
courseSchedule.repeatCount Integer

课程持续时长的数值,以 repeatFrequency 为单位。例如,如果 repeatFrequency 的单位为月,repeatCount 为 4,则课程持续 4 个月。

courseSchedule.repeatFrequency Text

durationrepeatCount 属性与此字段相关。请使用以下某个值:

  • Daily:课程每天进行。
  • Weekly:课程每周进行。
  • Monthly:课程每月进行。
  • Yearly:课程每年进行。
courseWorkload Text

此字段表示看完所有视频以及完成课程的所有作业和考试所用的总时间。请使用 8601 时长格式

"courseWorkload": "PT22H"
建议的属性
courseSchedule.duration Duration

建议的进度:一般用户可预期花费的时间(以 repeatFrequency 为单位),采用 8601 时长格式(如果适用)。例如,如果 repeatFrequency 的单位是月,durationPT5H,则用户应预期每月会花费 5 个小时。

请勿使用此属性指定课程的总长度。请改用 courseWorkload 属性。

courseSchedule.endDate Date

课程的结束日期,采用 8601 日期格式 (YYYY-MM-DD)(如果适用)。

courseSchedule.startDate Date

课程的开始日期,采用 8601 日期格式 (YYYY-MM-DD)(如果适用)。

image URL

链接到教师图片的网址(如果适用)。

其他的图片指南:

  • 图片网址必须可抓取且可编入索引。如需检查 Google 能否访问您的网址,请使用网址检查工具
  • 图片必须代表标记的内容。
  • 图片必须采用受 Google 图片支持的文件格式。
  • 为取得最佳效果,建议您提供具有以下宽高比的多个高分辨率图片(宽度乘以高度至少为 50K 像素):16x9、4x3 和 1x1。

例如:

"image": [
  "https://example.com/photos/1x1/photo.jpg",
  "https://example.com/photos/4x3/photo.jpg",
  "https://example.com/photos/16x9/photo.jpg"
]
instructor

可重复的 Person

授课教师的相关信息(如果适用)。

"instructor": [{
   "@type": "Person",
   "name": "Dana A.",
   "description": "Professor at X-University",
   "image": "http://examplePerson.jpg"
}]
instructor.description Text

教师及其凭证的说明(如果适用)。

instructor.name Text

教师的姓名(如果适用)。

location

Text

课程的实际授课地点的名称和/或地址(如果适用)。

"courseMode": "Blended",
"location": "Example High School"

课程计划

课程计划是一系列子课程的合集。子课程必须是独立的课程,具有不同的网址和着陆页。

如果您的网页是课程计划,应添加以下必需属性;CourseCourseInstance 部分中所列的其他必需属性除外。

必需的属性
hasPart

可重复的 Course

此计划所含的子课程的列表。

"@context": "https://schema.org/",
"@type": "Course",
"name": "Learning Pathway: Knitting",
"url": "www.example.com/knitprogram"
// Fill the other required Course and CourseInstance properties
"hasPart": [{
   "@type": "Course",
   "name": "Intro to Knitting",
   "url": "www.example.com/knitbasics",
   "description": "Learn the basics of how to knit."
   }, {
   "@type": "Course",
   "name": "Knit a Sweater",
   "url": "www.example.com/knitsweater",
   "description": "Learn to knit an entire sweater."
}]
hasPart.name Text

子课程的完整标题。

hasPart.url URL

链接到子课程着陆页的网址。

建议的属性
hasPart.description Text

对子课程所涵盖内容的简要说明(如果适用)。

  • 建议长度:240 个字符
  • 长度上限:500 个字符

使用 Search Console 监控富媒体搜索结果

Search Console 是一款工具,可帮助您监控网页在 Google 搜索结果中的显示效果。即使没有注册 Search Console,您的网页也可能会显示在 Google 搜索结果中,但注册 Search Console 能够帮助您了解 Google 如何查看您的网站并做出相应的改进。建议您在以下情况下查看 Search Console:

  1. 首次部署结构化数据后
  2. 发布新模板或更新代码后
  3. 定期分析流量时

首次部署结构化数据后

等 Google 将网页编入索引后,请在相关的富媒体搜索结果状态报告中查看是否存在问题。 理想情况下,有效项目数量会增加,而无效项目数量不会增加。如果您发现结构化数据存在问题,请执行以下操作:

  1. 修正无效项目
  2. 检查实际网址,核实问题是否仍然存在。
  3. 使用状态报告请求验证

发布新模板或更新代码后

如果对网站进行重大更改,请监控结构化数据无效项目的增幅。
  • 如果您发现无效项目增多了,可能是因为您推出的某个新模板无法正常工作,或者您的网站以一种新的错误方式与现有模板交互。
  • 如果您发现有效项目减少了(但无效项目的增加情况并不对应),可能是因为您的网页中未再嵌入结构化数据。请通过网址检查工具了解导致此问题的原因。

定期分析流量时

请使用效果报告分析您的 Google 搜索流量。数据将显示您的网页在 Google 搜索结果中显示为富媒体搜索结果的频率、用户点击该网页的频率以及网页在搜索结果中的平均排名。您还可以使用 Search Console API 自动提取这些结果。

Troubleshooting

If you're having trouble implementing or debugging structured data, here are some resources that may help you.

  • If you're using a content management system (CMS) or someone else is taking care of your site, ask them to help you. Make sure to forward any Search Console message that details the issue to them.
  • Google does not guarantee that features that consume structured data will show up in search results. For a list of common reasons why Google may not show your content in a rich result, see the General Structured Data Guidelines.
  • You might have an error in your structured data. Check the list of structured data errors and the Unparsable structured data report.
  • If you received a structured data manual action against your page, the structured data on the page will be ignored (although the page can still appear in Google Search results). To fix structured data issues, use the Manual Actions report.
  • Review the guidelines again to identify if your content isn't compliant with the guidelines. The problem can be caused by either spammy content or spammy markup usage. However, the issue may not be a syntax issue, and so the Rich Results Test won't be able to identify these issues.
  • Troubleshoot missing rich results / drop in total rich results.
  • Allow time for re-crawling and re-indexing. Remember that it may take several days after publishing a page for Google to find and crawl it. For general questions about crawling and indexing, check the Google Search crawling and indexing FAQ.
  • Post a question in the Google Search Central forum.