Event Schema Framework

Use conditional-logic schema generation to keep Event markup aligned with real page state and avoid stale or invalid static templates.

When To Use It

Google Search CentralEvent documentation

Use on the leaf page of a single event that is bookable by the general public and takes place at a physical location. Virtual-only events are not supported.

Key Implementation Documentation Highlights

  • Required properties: name, startDate, location. location must be a Place with a PostalAddress in location.address; virtual-only events (a VirtualLocation with no physical venue) are not supported.
  • Recommended properties: description, endDate, eventStatus, image, offers, organizer, performer, previousStartDate, plus location.name and every address part (streetAddress, addressLocality, addressRegion, postalCode, and addressCountry as a 2-letter ISO 3166-1 code). Give a full street address, not just a city.
  • startDate and endDate are ISO 8601 with a UTC/GMT offset (without one, Google uses the venue's timezone). Use a date only for all-day events, never a placeholder midnight start, and keep endDate on or after startDate. Multi-day events need both dates.
  • eventStatus is EventScheduled (the default), EventCancelled, EventPostponed or EventRescheduled. Keep startDate when the status changes; previousStartDate is only valid with EventRescheduled.
  • offers: one Offer per ticket type. price is the lowest available price including fees (0 for free events), priceCurrency is a 3-letter ISO 4217 code, availability is InStock, SoldOut or PreOrder, and url must be a crawlable ticket page linked from the event page.
  • image: crawlable, indexable images of the event, at least 720px wide (1920px recommended), 16x9, 4x3 or 1x1, and at least 50,000 pixels.
  • name is the event title only: not the venue name, and no URLs or prices. Several performances with separate tickets need one Event each.
  • Availability: Australia, Brazil, Canada, Germany, India, Latin America, Spain, the UK and the US, in English, Portuguese, German and Spanish. Don't mark up products, coupons, business hours or other non-events.
  • Google expects content parity: every marked-up value must match what users can see on the page.
  • Validate with the Rich Results Test and URL Inspection, then monitor the related Search Console report for errors and warnings after deployment.

Template Approach

const pageData = {
  title: "Harbor Lights Quartet: Winter Standards Night",
  startDate: "2026-11-14T19:30:00-05:00",
  venueName: "Riverside Music Hall",
  street: "120 Moody Street",
  city: "Waltham",
  region: "MA",
  postalCode: "02453",
  image: "https://www.example.com/images/harbor-lights-16x9.jpg"
};

const staticTemplate = {
  "@context": "https://schema.org",
  "@type": "Event",
  "name": pageData.title,
  "startDate": pageData.startDate,
  "eventStatus": "https://schema.org/EventScheduled",
  "location": {
    "@type": "Place",
    "name": pageData.venueName,
    "address": {
      "@type": "PostalAddress",
      "streetAddress": pageData.street,
      "addressLocality": pageData.city,
      "addressRegion": pageData.region,
      "postalCode": pageData.postalCode,
      "addressCountry": "US"
    }
  },
  "image": [pageData.image]
};

Conditional-logic Framework

const ISO_DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?(Z|[+-]\d{2}:\d{2})?)?$/;

function isAbsoluteUrl(value) {
  return typeof value === "string" && /^https?:\/\/[^\s/?#]+\.[^\s/?#]+(?:[/?#]\S*)?$/i.test(value);
}

// Returns the ISO 8601 string unchanged (timezone offset kept), or null if unparseable.
function toIsoDateTime(value) {
  if (typeof value !== "string") return null;
  const text = value.trim();
  const m = text.match(ISO_DATE_TIME);
  if (!m) return null;
  const [, y, mo, d, h = "00", mi = "00", s = "00"] = m;
  const date = new Date(Date.UTC(+y, +mo - 1, +d));
  if (date.getUTCMonth() !== +mo - 1 || date.getUTCDate() !== +d) return null;
  if (+h > 23 || +mi > 59 || +s > 59) return null;
  return text;
}

function toIsoDate(value) {
  const iso = toIsoDateTime(value);
  return iso ? iso.slice(0, 10) : null;
}

// Drops null, undefined, "", [] and {} recursively.
function compact(value) {
  if (Array.isArray(value)) {
    const items = value.map(compact).filter((v) => v !== undefined);
    return items.length ? items : undefined;
  }
  if (value && typeof value === "object") {
    const out = {};
    for (const [key, v] of Object.entries(value)) {
      const c = compact(v);
      if (c !== undefined) out[key] = c;
    }
    return Object.keys(out).length ? out : undefined;
  }
  return value === null || value === undefined || value === "" ? undefined : value;
}

function passesPageGates(source) {
  if (source.indexable === false) return false;
  if (source.canonicalUrl && source.url && source.canonicalUrl !== source.url) return false;
  return source.contentVisible !== false;
}


const EVENT_STATUS = {
  scheduled: "https://schema.org/EventScheduled",
  cancelled: "https://schema.org/EventCancelled",
  postponed: "https://schema.org/EventPostponed",
  rescheduled: "https://schema.org/EventRescheduled"
};
const TICKET_AVAILABILITY = {
  in_stock: "https://schema.org/InStock",
  sold_out: "https://schema.org/SoldOut",
  pre_order: "https://schema.org/PreOrder"
};

function buildPostalAddress(address = {}) {
  const country = String(address.country || "").toUpperCase();
  return {
    "@type": "PostalAddress",
    streetAddress: address.street,
    addressLocality: address.locality,
    addressRegion: address.region,
    postalCode: address.postalCode,
    addressCountry: /^[A-Z]{2}$/.test(country) ? country : null
  };
}

function buildOffer(ticket) {
  const price = Number(ticket.price);
  const currency = String(ticket.currency || "").toUpperCase();
  // Price includes fees; 0 means free. Currency is a 3-letter ISO 4217 code.
  if (ticket.price == null || !Number.isFinite(price) || price < 0 || !/^[A-Z]{3}$/.test(currency)) return null;
  return {
    "@type": "Offer",
    name: ticket.name,
    price,
    priceCurrency: currency,
    availability: TICKET_AVAILABILITY[ticket.availability] || null,
    validFrom: toIsoDateTime(ticket.onSaleFrom),
    url: isAbsoluteUrl(ticket.url) ? ticket.url : null
  };
}

function buildEventSchema(source) {
  // (a) Page gates: indexable, self-canonical, event visible on this leaf page.
  if (!passesPageGates(source)) return null;

  // (b) Required: name, startDate, location (a physical Place with a PostalAddress).
  const venue = source.venue || {};
  const toDate = source.allDay ? toIsoDate : toIsoDateTime; // all-day events: date only, no fake midnight
  const startDate = toDate(source.startDate);
  if (!source.name || !startDate) return null;
  if (source.attendanceMode === "online" || !venue.address) return null; // virtual-only events are not supported
  if (venue.name && venue.name === source.name) return null; // the event title must not be the venue name

  // (d) Custom rules: status enum, endDate not before startDate, previousStartDate only when rescheduled.
  const status = EVENT_STATUS[source.status] || EVENT_STATUS.scheduled;
  let endDate = toDate(source.endDate);
  if (endDate && Date.parse(endDate) < Date.parse(startDate)) endDate = null;
  const previousStartDate = status === EVENT_STATUS.rescheduled
    ? (source.previousStartDates || []).map(toDate)
    : null;

  // (c) Required + recommended properties, only when the source has them.
  const schema = {
    "@context": "https://schema.org",
    "@type": "Event",
    name: source.name,
    description: source.description,
    startDate, // keep startDate even when the event is cancelled or postponed
    endDate,
    eventStatus: status,
    previousStartDate,
    location: {
      "@type": "Place",
      name: venue.name,
      address: buildPostalAddress(venue.address)
    },
    image: (source.images || []).filter(isAbsoluteUrl),
    offers: (source.tickets || []).map(buildOffer), // one Offer per ticket type
    organizer: source.organizer && {
      "@type": source.organizer.type === "Person" ? "Person" : "Organization",
      name: source.organizer.name,
      url: isAbsoluteUrl(source.organizer.url) ? source.organizer.url : null
    },
    performer: (source.performers || []).map((p) => ({
      "@type": p.type === "Person" ? "Person" : "PerformingGroup",
      name: p.name
    }))
  };

  // (e) Strip empty values.
  return compact(schema);
}

// Usage:
// const source = {
//   "url": "https://www.example.com/events/harbor-lights-quartet-boston",
//   "canonicalUrl": "https://www.example.com/events/harbor-lights-quartet-boston",
//   "indexable": true,
//   "contentVisible": true,
//   "name": "Harbor Lights Quartet: Winter Standards Night",
//   "description": "An evening of jazz standards from the Harbor Lights Quartet, with a guest vocalist for the second set.",
//   "startDate": "2026-11-14T19:30:00-05:00",
//   "endDate": "2026-11-14T22:00:00-05:00",
//   "status": "scheduled",
//   "attendanceMode": "offline",
//   "venue": {
//     "name": "Riverside Music Hall",
//     "address": {
//       "street": "120 Moody Street",
//       "locality": "Waltham",
//       "region": "MA",
//       "postalCode": "02453",
//       "country": "US"
//     }
//   },
//   "images": [
//     "https://www.example.com/images/harbor-lights-16x9.jpg",
//     "https://www.example.com/images/harbor-lights-4x3.jpg",
//     "https://www.example.com/images/harbor-lights-1x1.jpg"
//   ],
//   "tickets": [
//     {
//       "name": "General admission",
//       "price": 35,
//       "currency": "usd",
//       "availability": "in_stock",
//       "onSaleFrom": "2026-09-01T10:00:00-04:00",
//       "url": "https://www.example.com/events/harbor-lights-quartet-boston/tickets"
//     }
//   ],
//   "organizer": {
//     "type": "Organization",
//     "name": "Riverside Music Hall",
//     "url": "https://www.example.com"
//   },
//   "performers": [
//     {
//       "type": "PerformingGroup",
//       "name": "Harbor Lights Quartet"
//     }
//   ]
// };
// const schema = buildEventSchema(source); // null when a gate or required property fails

The Output As An Entity Graph

The conditional-logic output above, parsed in your browser and drawn as the graph a crawler builds from it. Every nested object is a node and the property that holds it is the edge. Tap a node to inspect its properties, or drag to rearrange.

Why Conditional Logic Is Better Than Static Templates

  • Prevents emitting empty, null, or stale fields that frequently trigger rich result warnings.
  • Supports multiple page states (for example: no rating yet, no image yet, no offers yet) without duplicate templates.
  • Lets engineering teams centralize schema policy checks and validation in reusable code paths.
  • Makes large-scale schema maintenance safer when content models evolve over time.

Property Reference

What Google's Event documentation requires and recommends, property by property. These are the same rules the SchemaCDN validator checks. Each name links to its schema.org definition.

Event properties in Google's documentation
PropertyGoogleExpectsNotes
locationRequiredPlaceThe location of the event. Set the @type to Place and add location.address and location.name.
location.addressRequiredPostalAddressThe venue's detailed street address.
location.nameRecommendedTextThe detailed name of the place or venue where the event is being held. Don't put the title of the event in this field.
nameRequiredTextThe full title of the event. Don't put the name of the event location.
startDateRequiredDateTime or DateThe start date and start time of the event in ISO 8601 format.
descriptionRecommendedTextDescription of the event. Describe all details of the event to make it easier for users to understand and attend.
endDateRecommendedDateTime or DateThe end date and end time of the event in ISO 8601 format.
eventStatusRecommendedEnumThe status of the event; defaults to EventScheduled. One of: EventScheduled, EventCancelled, EventPostponed, EventRescheduled.
imageRecommendedURL or ImageObject, can repeatURL of an image or logo for the event or tour (1920px wide recommended, minimum 720px) Aspect ratios: 16x9, 4x3, 1x1.
offersRecommendedOffer, can repeatA nested Offer, one for each ticket type.
offers.availabilityRecommendedEnumOne of InStock, SoldOut, PreOrder.
offers.priceRecommendedNumberThe lowest available price for your tickets, including service charges and fees.
offers.priceCurrencyRecommendedTextThe 3-letter ISO 4217 currency code.
offers.validFromRecommendedDateTimeThe date and time when tickets go on sale, in ISO 8601 format.
offers.urlRecommendedURLThe URL of a page providing the ability to buy tickets.
organizerRecommendedOrganization or PersonThe person or organization that is hosting the event.
organizer.nameRecommendedTextThe name of the person or organization that's hosting the event.
organizer.urlRecommendedURLThe event host's domain URL.
performerRecommendedPerson or PerformingGroup, can repeatThe participants performing at the event, such as artists and comedians.
performer.nameRecommendedTextThe name of the participant performing at the event.
previousStartDateRecommendedDateTime or Date, can repeatThe previously scheduled start date if the event has been rescheduled.

Explore Other Schema Framework Pages

Retired Fact Check Use for fact-checking pages that evaluate a specific claim with a transparent rating methodology. ClaimReview Open Retired Home Activities Use for virtual classes and activities where participation details and timing are clearly listed. Event Open Retired How-To Use for instructional content that teaches a process through ordered steps and actionable detail. HowTo Open Image Metadata Use on image pages and image hosts that expose ownership and licensing information to search engines. ImageObject Open Job Posting Use for active job listings that include role details, hiring entity, and location/salary context. JobPosting Open Retired Learning Video Use for educational videos where the learning objective and pedagogical structure are explicit. LearningResource Open Local Business Use for physical businesses serving local customers with publicly verifiable contact and location details. LocalBusiness Open Loyalty Program Use to publish a loyalty program and its tiers once at the organization level, so member prices and member shipping can reference them. MemberProgram Open Math Solvers Use for pages that solve mathematical expressions and present step-by-step computational guidance. MathSolver Open Merchant Listing Use on pages where a product can be bought, with price, availability, shipping and return details. Product Open Limited Movie Use for movie detail pages with canonical film information and transparent metadata attribution. Movie Open Organization Use for official organization pages to clarify brand identity and authoritative entity signals. Organization Open Retired Practice Problems Use for educational practice content that presents solvable problems and answer validation structure. Quiz Open Product Snippet Use for product pages where pricing, availability, and product identity are visible to users. Product Open Product Variants Use when one product comes in variants such as size or color, grouped with ProductGroup. ProductGroup Open Profile Page Use for creator or contributor profile pages where identity attributes and ownership are explicit. ProfilePage Open Q&A Use for pages where users submit questions and community or editorial answers are displayed. QAPage Open Recipe Use for recipe pages with complete ingredients, instructions, and preparation details. Recipe Open Return Policy Use to publish a merchant return policy once at the organization level, with offer-level overrides. MerchantReturnPolicy Open Review Snippet Use when a page publishes genuine reviews tied to a clearly identified product, service, or entity. Review Open Shipping Policy Use to publish shipping rates, delivery times and destinations once at the organization level. ShippingService Open Site Name Use on the home page so Google shows the preferred site name in search results. WebSite Open Retired Sitelinks Search Box Use on sites with a functioning internal search endpoint that can accept URL query parameters. WebSite Open Software App (Beta) Use for software product pages that describe platform support and application category clearly. SoftwareApplication Open Limited Speakable Use for news-style pages where specific text segments are appropriate for text-to-speech playback. SpeakableSpecification Open Subscription and Paywalled Content Use for pages with restricted sections so Google can distinguish free previews from protected content. CreativeWork Open Limited Vacation Rental Use for rental property detail pages where booking-relevant amenities and location signals are explicit. VacationRental Open Retired Vehicle Listing Use for inventory pages selling vehicles with standardized listing fields and offer information. Car Open Video Use for pages where a primary video is embedded and key media metadata is visible on-page. VideoObject Open Article Use for editorial pages where the visible content is a complete article with a clear byline and publication timestamps. Article Open Limited Book Actions Use when your page helps users read, preview, or purchase books through clearly described actions. Book Open Breadcrumb Use on pages that belong to a clear hierarchy and display navigational trail links users can follow. BreadcrumbList Open Carousel Use when a page lists multiple related entities in a scannable sequence that can be surfaced as cards. ItemList Open Course Use for educational offerings where curriculum details, provider identity, and delivery context are explicit. Course Open Dataset Use for dataset landing pages so datasets are discoverable in Google Dataset Search with license, creator and download details. Dataset Open Discussion Forum Use for forum and community threads where a primary post and subsequent replies are publicly visible. DiscussionForumPosting Open Limited Education Q&A Use for educational question-answer pages where a single canonical answer and supporting context are visible. Quiz Open Employer Aggregate Rating Use on pages that publish employer rating aggregates from a clear and policy-compliant review source. EmployerAggregateRating Open Retired Estimated Salary Use for compensation insight pages that present transparent salary ranges for specific occupations and locations. Occupation Open

Implement Event Schema Frameworks Correctly

Get implementation support for conditional schema architecture, validation, and deployment governance.