Search code examples
schemaschema.orggoogle-shopping

Schema.org PriceSpecification with a sale price


I'm currently building a Schema.org template for an ecommerce website, for the purposes of generating a Google Shopping Feed.

I'm struggling to understand the correct way to define a sale price - i.e. a product which has a temporary reduced price.

The options I've considered areL

  • a single "Offer" with multiple "PriceSpecification" items
  • multiple "Offer" items with a single "PriceSpecification"
  • or maybe something else completely?

Single "Offer" with multiple "PriceSpecification" items

  "offers": {
    "@type": "Offer",
    "url": "https://kx.com/url",
    "itemCondition": "http://schema.org/UsedCondition",
    "availability": "http://schema.org/InStock",
    "PriceSpecification": [
      {
        "@type": "PriceSpecification",
        "price": 15.00,
        "priceCurrency": "USD"
      },
      {
        "@type": "PriceSpecification",
        "price": 15.00,
        "priceCurrency": "USD",
        "validFrom": "2020-01-01",
        "validThrough": "2020-02-01",
      }
    ],
  },

Multiple "Offer" items with a single "PriceSpecification"

  "offers": [
    {
      "@type": "Offer",
      "url": "https://kx.com/url",
      "itemCondition": "http://schema.org/UsedCondition",
      "availability": "http://schema.org/InStock",
      "PriceSpecification": [
        {
          "@type": "PriceSpecification",
          "price": 15.00,
          "priceCurrency": "USD"
        }
      ],
    },
    {
      "@type": "Offer",
      "url": "https://kx.com/url",
      "itemCondition": "http://schema.org/UsedCondition",
      "availability": "http://schema.org/InStock",
      "PriceSpecification": [
        {
          "@type": "PriceSpecification",
          "price": 15.00,
          "priceCurrency": "USD",
          "validFrom": "2020-01-01",
          "validThrough": "2020-02-01",
        }
      ],
    }
  ]
  },

Or is it something completely different? I'm struggling to find any conclusive documentation around this.


Solution

  • I'd note that Google strongly recommends the priceValidUntil value on Offer. I also usually use the rule of thumb that your Structured Data should match what's in your markup, so I think the starting point of the sale is likely unnecessary, especially for a Google shopping feed.

    If I were approaching this, I feel the safe route would be updating your Product structured data along with the content on the day of the sale, using the priceValidUntil field to note when that sale ends, then removing the attribute and updating the price once that date hits. You'd end up with something like:

     "offers": {
        "@type": "Offer",
        "url": "https://kx.com/url",
        "itemCondition": "http://schema.org/UsedCondition",
        "availability": "http://schema.org/InStock",
        "price": 15.00,
        "priceCurrency": "USD",
        "priceValidUntil": "2/1/2020"
      }
    

    In this example, on 2/1/2020 the priceValidUntil attribute would be removed and the price attribute would update, along with the content on the page.

    Your first example does validate in the Structured Data Testing Tool, but I don't think it will do you any good. I can see where you might want to advertise a sale ahead of time, but as far as I know a Google Shopping Feed/Carousel does not announce sales that are going to happen - just prices that are happening.

    A final note that while priceSpecification does validate on the testing tool and is applicable to a product, details around it seem a bit vague and I'd be hesitant in expecting it to provide much value. priceSpecification on schema.org has no example of it being used in a product (although again, not to say that means it is wrong).