用途
以下應用實例是 TrainReservation
結構定義的常見使用方式範例。請參考以下範例,確保標記的結構正確。
基本預訂確認
傳送預訂確認信時,請將下列標記嵌入電子郵件中。
Google 應用程式會在旅程當天顯示預訂詳細資料,並通知使用者準時抵達車站 (將交通方式、路況等因素納入考量)。如果您提供與下例類似的簽到網址,Google 應用程式會在行程前 24 小時內向使用者顯示這項資訊。
JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationNumber": "AB3XY2",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservationFor": {
"@type": "TrainTrip",
"departureStation": {
"@type": "TrainStation",
"name": "Munich Central"
},
"departureTime": "2017-01-04T10:30:00+01:00",
"arrivalStation": {
"@type": "TrainStation",
"name": "Paris Gare De Lyon"
},
"arrivalTime": "2017-01-04T03:10:00+01:00"
}
}
</script>
微資料
<div itemscope itemtype="http://schema.org/TrainReservation">
<meta itemprop="reservationNumber" content="AB3XY2"/>
<link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
<div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Munich Central"/>
</div>
<meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
<div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Paris Gare De Lyon"/>
</div>
<meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
</div>
</div>
登機證和票券
除了確認預訂確認外,你也可以另外用一封電子郵件發送確認卡登機證。
確認資訊卡不僅能協助使用者準時抵達火車站,還能在旅程期間向使用者顯示票券。因此,標記必須包含一些額外欄位。如需登機乘客的其他必填欄位,請將這些欄位加進 additionalTicketText
欄位。
如果票券沒有保留席,這些欄位為:numSeats
、ticketNumber
、ticketToken
JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationNumber": "AB3XY2",
"underName": {
"@type": "Person",
"name": "Eva Green"
},
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservationFor": {
"@type": "TrainTrip",
"departureStation": {
"@type": "TrainStation",
"name": "Munich Central"
},
"departureTime": "2017-01-04T10:30:00+01:00",
"arrivalStation": {
"@type": "TrainStation",
"name": "Paris Gare De Lyon"
},
"arrivalTime": "2017-01-04T03:10:00+01:00"
},
"reservedTicket": {
"@type": "Ticket",
"underName": "Eva Green",
"ticketNumber": "123XYZ",
"ticketToken": "aztecCode:AB34",
"additionalTicketText": "We recommend that you arrive at the station at least 30 minutes prior to your scheduled departure. Allow additional time if you need help with baggage or tickets."
}
}
</script>
微資料
<div itemscope itemtype="http://schema.org/TrainReservation">
<meta itemprop="reservationNumber" content="AB3XY2"/>
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="Eva Green"/>
</div>
<link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
<div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Munich Central"/>
</div>
<meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
<div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Paris Gare De Lyon"/>
</div>
<meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
</div>
<div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
<meta itemprop="underName" content="Eva Green"/>
<meta itemprop="ticketNumber" content="123XYZ"/>
<meta itemprop="ticketToken" content="aztecCode:AB34"/>
<meta itemprop="additionalTicketText" content="We recommend that you arrive at the station at least 30 minutes prior to your scheduled departure. Allow additional time if you need help with baggage or tickets."/>
</div>
</div>
如為有保留座椅的票券,以下欄位包括:seatNumber
、seatingType
、ticketNumber
、ticketToken
JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationNumber": "AB3XY2",
"underName": {
"@type": "Person",
"name": "Eva Green"
},
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservationFor": {
"@type": "TrainTrip",
"departureStation": {
"@type": "TrainStation",
"name": "Munich Central"
},
"departureTime": "2017-01-04T10:30:00+01:00",
"arrivalStation": {
"@type": "TrainStation",
"name": "Paris Gare De Lyon"
},
"arrivalTime": "2017-01-04T03:10:00+01:00"
},
"reservedTicket": {
"@type": "Ticket",
"underName": "Eva Green",
"ticketedSeat": {
"@type": "Seat",
"seatNumber": "27B",
"seatingType": "1st Class"
},
"ticketNumber": "123XYZ",
"ticketToken": "aztecCode:AB34",
"additionalTicketText": "We recommend that you arrive at the station at least 30 minutes prior to your scheduled departure. Allow additional time if you need help with baggage or tickets."
}
}
</script>
微資料
<div itemscope itemtype="http://schema.org/TrainReservation">
<meta itemprop="reservationNumber" content="AB3XY2"/>
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="Eva Green"/>
</div>
<link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
<div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Munich Central"/>
</div>
<meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
<div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Paris Gare De Lyon"/>
</div>
<meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
</div>
<div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
<meta itemprop="underName" content="Eva Green"/>
<div itemprop="ticketedSeat" itemscope itemtype="http://schema.org/Seat">
<meta itemprop="seatNumber" content="27B"/>
<meta itemprop="seatingType" content="1st Class"/>
</div>
<meta itemprop="ticketNumber" content="123XYZ"/>
<meta itemprop="ticketToken" content="aztecCode:AB34"/>
<meta itemprop="additionalTicketText" content="We recommend that you arrive at the station at least 30 minutes prior to your scheduled departure. Allow additional time if you need help with baggage or tickets."/>
</div>
</div>
多位乘客
如要描述內含多位乘客的預訂行程,請讓每位乘客使用每段車程 TrainReservation
。
JSON-LD
<script type="application/ld+json">
[
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationNumber": "AB3XY2",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservationFor": {
"@type": "TrainTrip",
"departureStation": {
"@type": "TrainStation",
"name": "Munich Central"
},
"departureTime": "2017-01-04T10:30:00+01:00",
"arrivalStation": {
"@type": "TrainStation",
"name": "Paris Gare De Lyon"
},
"arrivalTime": "2017-01-04T03:10:00+01:00"
},
"reservedTicket": {
"@type": "Ticket",
"underName": {
"@type": "Person",
"name": "Eva Green"
}
}
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationNumber": "AB3XY2",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservationFor": {
"@type": "TrainTrip",
"departureStation": {
"@type": "TrainStation",
"name": "Munich Central"
},
"departureTime": "2017-01-04T10:30:00+01:00",
"arrivalStation": {
"@type": "TrainStation",
"name": "Paris Gare De Lyon"
},
"arrivalTime": "2017-01-04T03:10:00+01:00"
},
"reservedTicket": {
"@type": "Ticket",
"underName": {
"@type": "Person",
"name": "John Green"
}
}
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationNumber": "AB3XY2",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservationFor": {
"@type": "TrainTrip",
"departureStation": {
"@type": "TrainStation",
"name": "Munich Central"
},
"departureTime": "2017-01-04T10:30:00+01:00",
"arrivalStation": {
"@type": "TrainStation",
"name": "Paris Gare De Lyon"
},
"arrivalTime": "2017-01-04T03:10:00+01:00"
},
"reservedTicket": {
"@type": "Ticket",
"underName": {
"@type": "Person",
"name": "Carol Green"
}
}
},
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationNumber": "AB3XY2",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"reservationFor": {
"@type": "TrainTrip",
"departureStation": {
"@type": "TrainStation",
"name": "Munich Central"
},
"departureTime": "2017-01-04T10:30:00+01:00",
"arrivalStation": {
"@type": "TrainStation",
"name": "Paris Gare De Lyon"
},
"arrivalTime": "2017-01-04T03:10:00+01:00"
},
"reservedTicket": {
"@type": "Ticket",
"underName": {
"@type": "Person",
"name": "Daniel Green"
}
}
}
]
</script>
微資料
<div itemscope itemtype="http://schema.org/TrainReservation">
<meta itemprop="reservationNumber" content="AB3XY2"/>
<link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
<div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Munich Central"/>
</div>
<meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
<div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Paris Gare De Lyon"/>
</div>
<meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
</div>
<div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="Eva Green"/>
</div>
</div>
</div>
<div itemscope itemtype="http://schema.org/TrainReservation">
<meta itemprop="reservationNumber" content="AB3XY2"/>
<link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
<div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Munich Central"/>
</div>
<meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
<div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Paris Gare De Lyon"/>
</div>
<meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
</div>
<div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="John Green"/>
</div>
</div>
</div>
<div itemscope itemtype="http://schema.org/TrainReservation">
<meta itemprop="reservationNumber" content="AB3XY2"/>
<link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
<div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Munich Central"/>
</div>
<meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
<div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Paris Gare De Lyon"/>
</div>
<meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
</div>
<div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="Carol Green"/>
</div>
</div>
</div>
<div itemscope itemtype="http://schema.org/TrainReservation">
<meta itemprop="reservationNumber" content="AB3XY2"/>
<link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
<div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Munich Central"/>
</div>
<meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
<div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Paris Gare De Lyon"/>
</div>
<meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
</div>
<div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="Daniel Green"/>
</div>
</div>
</div>
包含所有支援欄位的範例
以下是填入所有支援欄位的範例,供您參考:
JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "TrainReservation",
"reservationNumber": "AB3XY2",
"url": "http://eurotravel/view/AB3XY2",
"underName": {
"@type": "Person",
"name": "John Smith",
"email": "john@mail.com"
},
"programMembership": {
"@type": "ProgramMembership",
"memberNumber": "12345",
"program": "STA"
},
"bookingAgent": {
"@type": "Organization",
"name": "European Vacations",
"url": "http://eurotravel/"
},
"bookingTime": "2013-01-14T13:05:00-05:00",
"modifiedTime": "2013-03-14T13:05:00-05:00",
"confirmReservationUrl": "http://eurotravel/confirm?id=AB3XY2",
"cancelReservationUrl": "http://eurotravel/cancel?id=AB3XY2",
"modifyReservationUrl": "http://eurotravel/edit?id=AB3XY2",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"checkinUrl": "http://train.com/checkin?id=AB3XY2",
"reservationFor": {
"@type": "TrainTrip",
"trainNumber": "9203",
"trainName": "Orient Express",
"trainCode": "iGTV",
"trainCompany": {
"@type": "Organization"
},
"departureStation": {
"@type": "TrainStation",
"name": "Munich Central"
},
"departurePlatform": "64",
"departureTime": "2017-01-04T10:30:00+01:00",
"arrivalStation": {
"@type": "TrainStation",
"name": "Paris Gare De Lyon"
},
"arrivalPlatform": "101B",
"arrivalTime": "2017-01-04T03:10:00+01:00"
},
"reservedTicket": {
"@type": "Ticket",
"ticketNumber": "123XYZ",
"downloadUrl": "?",
"printUrl": "?",
"ticketToken": "qrCode:123456789",
"additionalTicketText": "?",
"price": "135.00",
"priceCurrency": "EUR",
"underName": {
"@type": "Person",
"name": "Mary Smith"
},
"ticketedSeat": {
"@type": "Seat",
"seatingType": "1st Class",
"seatNumber": "27",
"seatRow": "A"
}
}
}
</script>
微資料
<div itemscope itemtype="http://schema.org/TrainReservation">
<meta itemprop="reservationNumber" content="AB3XY2"/>
<link itemprop="url" href="http://eurotravel/view/AB3XY2"/>
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="John Smith"/>
<meta itemprop="email" content="john@mail.com"/>
</div>
<div itemprop="programMembership" itemscope itemtype="http://schema.org/ProgramMembership">
<meta itemprop="memberNumber" content="12345"/>
<meta itemprop="program" content="STA"/>
</div>
<div itemprop="bookingAgent" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="European Vacations"/>
<link itemprop="url" href="http://eurotravel/"/>
</div>
<meta itemprop="bookingTime" content="2013-01-14T13:05:00-05:00"/>
<meta itemprop="modifiedTime" content="2013-03-14T13:05:00-05:00"/>
<link itemprop="confirmReservationUrl" href="http://eurotravel/confirm?id=AB3XY2"/>
<link itemprop="cancelReservationUrl" href="http://eurotravel/cancel?id=AB3XY2"/>
<link itemprop="modifyReservationUrl" href="http://eurotravel/edit?id=AB3XY2"/>
<link itemprop="reservationStatus" href="http://schema.org/ReservationConfirmed"/>
<link itemprop="checkinUrl" href="http://train.com/checkin?id=AB3XY2"/>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/TrainTrip">
<meta itemprop="trainNumber" content="9203"/>
<meta itemprop="trainName" content="Orient Express"/>
<meta itemprop="trainCode" content="iGTV"/>
<div itemprop="trainCompany" itemscope itemtype="http://schema.org/Organization">
</div>
<div itemprop="departureStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Munich Central"/>
</div>
<meta itemprop="departurePlatform" content="64"/>
<meta itemprop="departureTime" content="2017-01-04T10:30:00+01:00"/>
<div itemprop="arrivalStation" itemscope itemtype="http://schema.org/TrainStation">
<meta itemprop="name" content="Paris Gare De Lyon"/>
</div>
<meta itemprop="arrivalPlatform" content="101B"/>
<meta itemprop="arrivalTime" content="2017-01-04T03:10:00+01:00"/>
</div>
<div itemprop="reservedTicket" itemscope itemtype="http://schema.org/Ticket">
<meta itemprop="ticketNumber" content="123XYZ"/>
<meta itemprop="downloadUrl" content="?"/>
<meta itemprop="printUrl" content="?"/>
<meta itemprop="ticketToken" content="qrCode:123456789"/>
<meta itemprop="additionalTicketText" content="?"/>
<meta itemprop="price" content="135.00"/>
<meta itemprop="priceCurrency" content="EUR"/>
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="Mary Smith"/>
</div>
<div itemprop="ticketedSeat" itemscope itemtype="http://schema.org/Seat">
<meta itemprop="seatingType" content="1st Class"/>
<meta itemprop="seatNumber" content="27"/>
<meta itemprop="seatRow" content="A"/>
</div>
</div>
</div>
測試標記
您可以使用電子郵件標記測試工具驗證標記。貼上標記程式碼,然後按一下「驗證」按鈕以掃描內容,並接收報告中列出的所有錯誤。
規格
請查看電子郵件的詳細資訊,確認其中是否有與火車預訂相關的房源。標記這些額外屬性,可讓 Google 向使用者顯示更豐富的火車預訂說明。
屬性 | 類型 | 說明 |
---|---|---|
reservationNumber | 文字 | (必要) 預留項目的編號或 ID。 |
網址 | 網址 | 可以檢視預訂項目的網頁。 |
underName | Person 或 Organization | 乘客。 |
underName.name | 文字 | (建議用於確認卡片/搜尋解答) 姓名。 |
underName.email | 文字 | 電子郵件地址。 |
programMembership | ProgramMembership | 系統會將常客傳單、飯店會員方案等使用者的會員資格套用至預訂。 |
programMembership.memberNumber | 文字 | 會員的 ID。 |
programMembership.program | 文字 | 學程計畫名稱。 |
bookingAgent | 機構或 Person | 預訂代理商或代理商。也接受字串 (例如「」)。 |
bookingAgent.name | 文字 | 虛擬服務專員/服務的名稱。 |
bookingAgent.url | 網址 | 服務專員/服務的網站。 |
bookingTime | DateTime | 訂位日期。 |
modifiedTime | DateTime | (適用於確認資訊卡/搜尋解答) 上次修改預訂的時間。 |
confirmReservationUrl | 網址 | 可確認預訂網頁。 |
cancelReservationUrl | 網址 | 可取消預訂的網頁。 |
modifyReservationUrl | 網址 | (建議用於確認資訊卡/搜尋答案) 預訂頁面 (可修改)。 |
reservationStatus | ReservationStatus | (必填) 預留項目的目前狀態。 |
checkinUrl | 網址 | 乘客可以報到的網頁。 |
reservationFor | TrainTrip | (必填) 火車行程相關資訊。 |
reservationFor.trainNumber | 文字 | (建議用於確認資訊卡/搜尋答案) 火車的編號。 |
reservationFor.trainName | 文字 | 火車的名稱。 |
reservationFor.trainCode | 文字 | 火車的專屬 ID。 |
reservationFor.trainCompany | 機構組織 | 營運火車的機構。也接受字串 (例如「」)。 |
reservationFor.departureStation | TrainStation | (必要) 火車出發站。 |
reservationFor.departureStation.name | 文字 | (必要) TrainStation 名稱。 |
reservationFor.departurePlatform | 文字 | 火車的發車月台。 |
reservationFor.departureTime | DateTime | (必填) 預計出發時間。 |
reservationFor.arrivalStation | TrainStation | (必要) 火車終點站。 |
reservationFor.arrivalStation.name | 文字 | (必要) TrainStation 名稱。 |
reservationFor.arrivalPlatform | 文字 | 火車的進站月台。 |
reservationFor.arrivalTime | DateTime | (必要) 預計抵達時間。 |
reservedTicket | 票券 | 票券資訊。 |
reservedTicket.ticketNumber | 文字 | 票券的編號或 ID。 |
reservedTicket.downloadUrl | 網址 | 。 |
reservedTicket.printUrl | 網址 | 。 |
reservedTicket.ticketToken | 文字或網址 | 如果條碼圖片是由您的網站代管,該欄位的值就是圖片的網址,或是條碼或 QR code (例如「barcode128:AB34」)(ISO-15417 條碼)、「qrCode:AB34」(QR code)、「aztecCode:AB34」(Aztec code)、「barcodeEAN:1234」(EAN 代碼) 和「barcodeUPCA:1234」(UPCA 代碼)。 |
reservedTicket.additionalTicketText | 文字 | 關於票券的其他說明文字。 |
reservedTicket.price | 文字 | 票券總價。 |
rereserveTicket.priceCurrency | 文字 | 票券價格的幣別 (3 個英文字母組成的 ISO 4217 格式), |
reservedTicket.underName | Person 或 Organization | 支援單的個人或機構。 |
reservedTicket.underName.name | 文字 | 人名。 |
reservedTicket.ticketedSeat | 座位: | 預留席位 (例如27B)。。 |
reservedTicket.ticketedSeat.seatingType | 文字 | 座位的類型/類別。 |
reservedTicket.ticketedSeat.seatNumber | 文字 | 預留座位的位置。 |
reservedTicket.ticketedSeat.seatRow | 文字 | 預留座位的排行位置。 |