LoginSignup
2
1

More than 3 years have passed since last update.

【SEO】【構造化データ】LocalBusiness

Last updated at Posted at 2020-05-29

LocalBusiness

以下の実装をしたケースの紹介です。
https://developers.google.com/search/docs/data-types/local-business?hl=ja

コード

今回はこちらのページに実装した例です。
このページは電気自動車の充電スポット情報のページになります。
テンプレート側で変数をechoしています。

structuredData.template
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
  "image": [
    "<?php echo $point_img; ?>"
  ],
  "@id": "<?php echo $point_pageUrl; ?>#LocalBusiness",
  "name": "<?php echo str_replace('"', '\"', $point_name); ?> EV電気自動車 充電スタンド",
  "address":
  {
    "streetAddress":"<?php echo $point_postal; ?>"
  },
  "description":"<?php echo str_replace('"', '\"', $point_name); ?>の充電スタンド情報ページです。利用可能時間や料金、プラグ形状、そしてユーザーの口コミなど情報満載!",
  "geo": {
    "@type": "GeoCoordinates",
    "latitude": <?php echo $point_latitude; ?>,
    "longitude": <?php echo $point_longitude; ?>
  },
  "url": "<?php echo $point_pageUrl; ?>",
  "telephone": "<?php echo $point_phoneNumber; ?>",
  "openingHours": ["Mo-Fr <?php echo $point_openingTimeWkStr; ?>", "Sa <?php echo $point_openingTimeSaStr; ?>", "Su <?php echo $point_openingTimeSuStr; ?>"]
}
</script>

テストツールで見るとこんな感じです。

2
1
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
1