2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Googleしごと検索のJSON-LDを作成

Last updated at Posted at 2019-12-25

公式ドキュメント

https://developers.google.com/search/docs/data-types/job-posting
まずは公式ドキュメントでポリシーを確認しましょう。

JSON-LDを作成

JSON-LD形式で求人ページにタグを埋め込めばbotがクロールしてくれます。
有効になった求人数はSearch Consoleで確認できます。

設置場所は基本的にheadタグ内ですが、bodyタグ内でも問題ないです。

用意する値

プロパティ名 変数名 説明
title $title 職務の名称。Googleのポリシーには求人のタイトルのような内容を入れないように記載されています。
datePosted $date_posted 求人情報が掲載されたの日付(ISO8601形式)
description $description HTMLタグが一部使用可能(p, brなど)
hiringOrganization $hiring_organization_name 企業名
$logo_url 企業ロゴ画像
jobLocation $address_region 都道府県
$address_locality 市区町村
$street_address 番地
$postal_code 勤務地の郵便番号
validThrough $valid_through 求人情報の掲載期限日付(ISO8601形式)
employmentType (任意) $employment_type = 'PART_TIME'; アルバイト
$employment_type = 'FULL_TIME'; 正社員
$employment_type = 'CONTRACTOR'; 契約社員
$employment_type = 'TEMPORARY'; 派遣社員
$employment_type = 'OTHER'; その他
baseSalary (任意) $min_salary 最低給与額
$max_salary 最高給与額
$salary_span = 'HOUR'; 時給
$salary_span = 'DAY'; 日給
$salary_span = 'WEEK'; 週給
$salary_span = 'MONTH'; 月給
$salary_span = 'YEAR'; 年収
identifier (任意) $identifier_name 求人情報の一意の識別子名
$identifier_value 求人情報の一意の値

JSON-LDの作成

上記の値を下記のようにまとめたら、タグを埋め込みます。

create_jobpost.php
$json_ld =
<<<EOD
<script type="application/ld+json">
{
  "@context" : "http://schema.org/",
  "@type" : "JobPosting",
  "title" : "$title",
  "description" : "$description",
  "datePosted" : "$date_posted",
  "validThrough" : "$valid_through",
  "hiringOrganization" : {
    "@type" : "Organization",
    "name" : "$hiring_organization_name",
    "logo": "$logo_url"
  },
  "jobLocation" : {
    "@type" : "Place",
    "address" : {
      "@type" : "PostalAddress",
      "addressCountry": "JP",
      "addressRegion" : "$address_region",
      "addressLocality" : "$address_locality",
      "streetAddress" : "$street_address",
      "postalCode" : "$postal_code"
    }
  },
  "employmentType" : [$employment_type],
  "baseSalary": {
    "@type": "MonetaryAmount",
    "currency": "JPY",
    "value": {
      "@type": "QuantitativeValue",
      "minValue": $min_salary,
      "maxValue": $max_salary,
      "unitText": "$salary_span" 
    }
  },
  "identifier": {
    "@type": "PropertyValue",
    "name": "$identifier_name",
    "value": "$identifier_value" 
  }
}
</script>
EOD;

作成したJSON-LDデータのテスト方法

Googleの構造化データテストツールで確認
https://search.google.com/structured-data/testing-tool/u/0/?hl=ja

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?