Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@bubbles

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

More than 1 year has passed since last update.

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>

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

0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
bubbles
php、laravel、sqlserver、mysql、javascript、swift。
ayudante
いつもユーザー中心で技術者とコンサルタントがとことん考え抜く それがアユダンテです

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?