Announcement

Collapse
No announcement yet.

Schema.org microdata

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Schema.org microdata

    Google Shopping keeps warning me that my product pages lack the microdata of price, availability and condition. My feed still works but perhaps it would perform better if this microdata was included.

    To include the bare minimum I have adjusted an example I found in google developers pages, and a bit from an old post of Normans.

    Before I implement it I was wondering if anyone else had done this and does my code look right?

    I intend to place it within the body of the product page template.

    Is there a better way to implement the In Stock/Out of Stock variable?

    Code:
    <body>
      <div itemscope itemtype="http://schema.org/Product">
        <span itemprop="name"><actinic:variable name="ProductName" /></span>
    
        <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
          <meta itemprop="priceCurrency" content="GBP" />£
          <span itemprop="price"><actinic:variable name="ProductPriceRaw" /></span>
          <meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition"/>New
          <actinic:block if="%3cactinic%3avariable%20name%3d%22IsInStock%22%20%2f%3e" >
          <meta itemprop="availability" href="http://schema.org/InStock" />In stock
          </actinic:block>
        </div>
      </div>
    </body>
    Arka Tribal Jewellery

    #2
    Hi Mark, thanks for the post with your suggestion for code for microdata, we are looking at how to deal with this too and are a bit surprised to see how quiet it is on the forum. Did you try it? and did it work?

    Peter R
    Blademail

    Comment


      #3
      You might find this page useful

      https://developers.google.com/struct...ppets/products

      Comment


        #4
        does my code look right
        Best lose the <body> and </body> tags as this code will (presumably) be put within a Product Page Layout and that's already within your page body.

        It also looks like you want to display this information so be aware that ProductPriceRaw will not put in the pennies part for whole pound prices. You'll need a bit of PHP to reformat said price. Plenty of examples on the Community.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Hi Peter, I must admit I didnt try this out yet.

          Other things got more important!

          Thanks Norman for the tip regarding the price...and Gary for the link.

          I also noticed that in my code I didnt include the image yet!
          Arka Tribal Jewellery

          Comment


            #6
            Code:
            <actinic:block php="true">printf('%01.2f', '<actinic:variable name="ProductPriceRaw" selectable="false" />');</actinic:block>
            The above will output a price of 123 as 123.00.
            P.S. The quotes around the ProductPriceRaw variable are just in case it's ever null, when it will be treated as 0.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              I have had lots of fun with this subject, your code works well but does throw the product name in small text on the visible product page.

              Structured data testing tool is all good.
              https://www.harrisontelescopes.co.uk/

              Ed Harrison - Menmuir Scotland

              Comment


                #8
                Thanks Norman for the php

                >>your code works well but does throw the product name in small text on the visible product page
                Does it? Thats not good.
                Arka Tribal Jewellery

                Comment


                  #9
                  At the bottom of the product text when I tested it on my site, my version does not but its still messy, price raw by the way if I remember correct will be ex vat.

                  See my thread about page 2 on this section for my woes with it - code is there to if you need to take any bits, Norman kindly resolved the ex vat price issue to.
                  https://www.harrisontelescopes.co.uk/

                  Ed Harrison - Menmuir Scotland

                  Comment


                    #10
                    Blimey this is all a bit confusing isnt it!
                    Your other thread made me doubt myself.

                    This is the latest code I have, including Normans tweaks


                    Code:
                    <!-- microdata start -->
                    
                    	<div itemscope itemtype="http://schema.org/Product">
                            <span itemprop="name"><actinic:variable name="ProductName" /></span>
                            <img itemprop="image"> src="<actinic:variable name="CatalogURL" /><actinic:variable name="ProductImageFileName" />" />
                            <span itemprop="description"><actinic:variable name="ProductDescription" /></span>
                            <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                            <meta itemprop="priceCurrency" content="GBP" />£
                            <span itemprop="price"><actinic:block> php="true">printf('%01.2f', <actinic:variable name="ProductPriceRaw" />);</actinic:block> /></span>
                            <meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="New"/>
                            <actinic:block if="%3cactinic%3avariable%20name%3d%22IsInStock%22%20%2f%3e" >
                            <meta itemprop="availability" href="http://schema.org/InStock" />In stock</actinic:block>
                            </div>
                            </div>
                    	<!-- microdata send -->
                    Arka Tribal Jewellery

                    Comment


                      #11
                      That one gives coding errors...
                      https://www.harrisontelescopes.co.uk/

                      Ed Harrison - Menmuir Scotland

                      Comment


                        #12


                        ok I think I'll use your code!
                        Arka Tribal Jewellery

                        Comment


                          #13
                          Google Shopping Microdata

                          This has been niggling me for about 3 years with google merchant notifications on 3000+ products.
                          I tried the rich snippets code from a previous post and this made no difference to the microdata notifications. Only recently this month September 2016 I noticed that the notifications had reduced to <1000, however, it appeared as though the sampling was targeted to products with past clicks over a 30 day period in that some 25% of products were sampled that impacted on 95% past clicks.
                          The number of click conversions has dropped off significantly over the past week and I suspect that the microdata notifications may now be linked up in some way, so I decided to take a closer look at the coding required using the Google Merchant Guidance and structured data test tool links below:

                          https://support.google.com/merchants...83460?hl=en-GB

                          https://search.google.com/structured-data/testing-tool

                          This through up a couple of errors:
                          GTIN not defined - rectified by setting GTIN to repsective EAN and UPC variable
                          name (fn) field not defined - rectified by setting name field to ProductName variable

                          This has resulted in the code set out below being applied to the product layouts

                          <!-- microdata BEGIN -->
                          <div itemscope itemtype="http://schema.org/Product">
                          <meta itemprop="sku" content="<actinic:variable name="ProductID" />" />
                          <meta itemprop="name" content="<actinic:variable name="ProductName" />" />
                          <meta itemprop="description" content="<actinic:variable name="ProductDescription" />" />
                          <meta itemprop="image" content="<actinic:variable name="CatalogURL" /><actinic:variable name="ProductImageFileName" />" />
                          <meta itemprop="brand" content="<actinic:variable name="brand" />" />
                          <meta itemprop="mpn" content="<actinic:variable name="mpn" />" />
                          <meta itemprop="gtin13" content="<actinic:variable name="ean" />" />
                          <meta itemprop="gtin12" content="<actinic:variable name="upc" />" />
                          <meta itemprop="itemCondition" content="NewCondition" />
                          <meta itemprop="category" content="<actinic:variable name="google_product_category" />"/>
                          </div>
                          <div class="purchase_data" itemprop="offerDetails" itemscope itemtype="http://schema.org/Offer">
                          <meta itemprop="priceCurrency" content="GBP" />
                          <meta itemprop="availability" content="InStock" />
                          <meta itemprop="price" content=<actinic:variable name="ProductPriceRaw" /> />
                          <meta itemprop="seller" content="<actinic:variable name="CompanyName" />"/>
                          </div>
                          <!-- microdata END -->

                          The above coding is error free for my application (other applications will need to be checked for specifics!) and I am just waiting to see if this clears the microdata notifications. If not then I will endeavour to determine exactly what is needed to get this resolved with Google Merchant Centre.

                          Martin Nichols
                          http://www.mantra-audio.co.uk
                          Martin
                          Mantra Audio

                          Comment


                            #14
                            Seems Google picks up different errors on different feeds!

                            My feed has no GTIN error but keeps telling me the condition variable is missing --- it isnt!

                            I'm using the code on this post which is part of a newer thread on the subject that this thread.
                            http://community.sellerdeck.com/showthread.php?t=56461

                            I have nothing in my feed about GTIN.... and no reported error either.
                            Arka Tribal Jewellery

                            Comment


                              #15
                              I eventually got the condition variable bottomed out using the modified code below. The condition variable code had to be moved from the schema.org/product group to the ../offer grouping and presented as a direct link to schema.org definition as shown.
                              I had a further problem with the price line code in that the "price" that is passed to the data feed text is a VAT inclusive amount mandated for Europe market, whereas the ProductPriceRaw variable is the base price excluding VAT. This resulted in an insufficent match of microdata price information warning. I tried replacing the "ProductPriceRaw" variable with the "Price" variable in the microdata code and this returned an automatic item update: invalid microdata for price notification "NETQUOTEVAR:PRICE on all landing pages. Could not get this resolved for SellerDeck 2014 so decided to remove price code line altogether and the code now seems to be working through OK. On reading through the Google blurb it does appear that the price data will need to be fixed in time as a requirement for automatic feed updates.
                              I have not had any errors reported on microdata GTIN but included the code just in case this was presented in future as I have had to include GTINs (EANs, UPCs) for some designated manufacturer brands in the data feeds to avoid item dissaprovals.
                              Updated Code
                              <!-- microdata BEGIN -->
                              <div itemscope itemtype="http://schema.org/Product">
                              <meta itemprop="sku" content="<actinic:variable name="ProductID" />" />
                              <meta itemprop="name" content="<actinic:variable name="ProductName" />" />
                              <meta itemprop="description" content="<actinic:variable name="ProductDescription" />" />
                              <meta itemprop="image" content="<actinic:variable name="CatalogURL" /><actinic:variable name="ProductImageFileName" />" />
                              <meta itemprop="brand" content="<actinic:variable name="brand" />" />
                              <meta itemprop="mpn" content="<actinic:variable name="mpn" />" />
                              <meta itemprop="gtin13" content="<actinic:variable name="ean" />" />
                              <meta itemprop="gtin12" content="<actinic:variable name="upc" />" />
                              <meta itemprop="category" content="<actinic:variable name="google_product_category" />" />
                              </div>
                              <div class="purchase_data" itemprop="offerDetails" itemscope itemtype="http://schema.org/Offer">
                              <meta itemprop="priceCurrency" content="GBP" />
                              <meta itemprop="availability" content="http://schema.org/InStock" />
                              <meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition" />
                              <meta itemprop="seller" content="<actinic:variable name="CompanyName" />"/>
                              </div>
                              <!-- microdata END -->
                              Martin
                              Mantra Audio

                              Comment

                              Working...
                              X