When Liffery scrapes your website, along with all the other metadata we also aim to accurately pull out the price, if available, of the product that the person has posted.
The screenshot to the right (above on mobile) shows the most common place where someone on Liffery will see the price of a product. That is on the item card itself which is found on their dashboard, profile page, or channel page.
We support all currencies in the world and whenever possible will use the relevant currency symbol to represent the currency.
Formatting your website #
To ensure that Liffery correctly gets the relevant price from your website there are two methods for structuring your data that you can use to help us.
OG Tags #
Open Graph (OG) is a protocol introduced by Facebook and adopted by much of the web to standardise rich content across social media. At Liffery we also utilise OG tags. We will first look for any OG tags on a site and if available will use the data within those to make decisions. As well as type, image, description, title, you can also include your pricing data here.
The most efficient way is as so:
- Set the og:type to “product”. This tells us unequivocally we are looking at a product which will have a price.
<meta property="og:type" content="product" />
- Use the property “product:price:amount” and it’s corresponding content value to set the price.
<meta property="product:price:amount" content="12.50" />
- Use the property “product:price:currency” and it’s corresponding content value to set the currency. Use the ISO 4217 international standard 3-letter currency code, e.g. GBP.
<meta property="product:price:currency" content="GBP" />
These 3 OG tags will guarantee we get the correct price and format it in the correct way on Liffery. The above will be £12.50. If you have set your og:type to something other than product, we also accept the properties “og:price:amount” and “og:price:currency” instead to represent your pricing data.
Please note: Any data we find in OG tags is at the highest level of hierarchy of what we find important. That is to say, if you have price data in OG tags and in JSON-LD tags, we will only keep the OG pricing data.
JSON-LD #
JSON-LD (linked data) is another standardised way to represent rich data in a structured way to be used across social media. Whereas OG tags are more limited in what data you can provide but are quick to scan, JSON-LD is a little slower to scan but offers far more options for rich data. JSON-LD is formatted according to Schema.org. You can read all the available schema’s on their website; if looking at an example, be sure to select the JSON-LD tab as we don’t read RDFa or Microdata.
There are many different types of schema’s but if we find the product object we will give preference to any data found in here. It is the second highest in the hierarchy of what we find important behind OG tags.
Preferably within a product object, but can be at any level, you should include an offers object to hold your pricing data.
The pricing data looks like this where the currency is an ISO 4217 international standard 3-letter currency code:
"priceCurrency":"GBP",
"price":"27.99"
As simple as that. A full JSON-LD script tag including pricing data might look like:
<script type="application/ld+json">
{
"@context":"https://schema.org/",
"@type":"product",
"offers":{
"@type":"Offer",
"availability":"https://schema.org/InStock",
"url":"https://shop.liffery.com/products/organic-canvas-tote-bag",
"priceCurrency":"GBP",
"price":"41.05"
},
"productId":"6368471",
"sku":"109222604",
"url":"https://shop.liffery.com/products/organic-canvas-tote-bag",
"name":"Organic Canvas Tote Bag",
"description":"Designed with nature-approved materials, these personalized Econscious EC8040 canvas tote bags come with a 100% certified-organic cotton body and web handles.",
"image":"https://cdn.shopify.com/s/files/1/0558/7982/7595/products/35bff1ab030890e922eeb8df09d271e0.jpg?v=1643917810",
}
</script>
The advantage of a JSON-LD tag is that the script tag can be injected anywhere on the page. It doesn’t have to be in the header. This makes it easier for Content Management Systems such as WordPress or Shopify to inject this data onto the page automatically without you needing to know how to code yourself. If your CMS is not currently doing this please get in touch with them to ask how. Or if you are managing it yourself please research how to add JSON-LD to the product pages of your chosen CMS.
Backup Price #
If you do not provide OG tags containing the price or a properly structured JSON-LD script tag then Liffery will attempt to find the price in the html that we scrape. This is, however, a last resort. While we have done our best to ensure we extract the correct price, it will never be as accurate as explicitly stating the price in a structured way as per the examples above.