Zen Cart Logo
Forums / Addon Admin Tools / Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Views: 91,626

Results 121 to 140 of 212
22 Oct 2021, 3:26 PM
#121
marcopm avatar

marcopm

New Zenner

Join Date:
Jun 2021
Posts:
42
Plugin Contributions:
1

Structured Data Markup for Schema, Facebook Open Graph, Twitter...

richard7315:

Thank you for offering the structured data add on. We have been testing this mod and it seems to work well for adding structured data.

We have tried to setup a google merchant center feed using the ‘website crawl’ option. Unfortunately we have been unable to get any products approved (our account uses weight based shipping).

The schema.org test states that “weight” is the correct attribute and does not generate any errors. However after google had completed the ‘website crawl’ all of our products were disapproved due to a missing value for the shipping_weight.

We have contacted google support and they claimed that the correct attribute is “shipping_weight” instead of “weight”. Updating the attribute appeared to make no difference. Google still disapproved all products and schema.ora stated that there was now an error.

As we cannot supply the weight to google and products do not update very often, we have decided to use an alternative mod https://github.com/torvista/Zen_Cart-Google_Merchant_Center_Feeder

Hopefully this post will help other users as I have spent five days trying to get the ‘website crawl’ feed to work correctly but have not found a solution. I would still recommend using the structured data mod to improve organic search rankings. Unfortunately it does not appear to be compatible with merchant center weight based shipping.

I had the same problem, Google does not read the shipping_weight attribute from structured data.
I solved by setting up a supplemental feed on Google Merchant Center. Basically a simple xls file where each row is a product, the first column is the product id and the second column the shipping_weight. When Google reads this file, it merges the shipping_weight data with the other product information that he crawled from the website.

28 Oct 2021, 3:35 AM
#122
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

I'm getting these errors in google:

Missing field "url"

No global identifier provided (e.g., gtin, mpn, isbn)

If I can I'd like to get rid of these errors, and I have already run the SQL code supplied to create the extra fields.

However, I would like to populate these fields from the admin side rather than having to edit the database everytime. So is there code to create the extra fields from admin > categories/products > category name > product info

28 Oct 2021, 3:38 AM
#123
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Nick1973:

I'm getting these errors in google:

Missing field "url"

No global identifier provided (e.g., gtin, mpn, isbn)

If I can I'd like to get rid of these errors, and I have already run the SQL code supplied to create the extra fields.

However, I would like to populate these fields from the admin side rather than having to edit the database everytime. So is there code to create the extra fields from admin > categories/products > category name > product info

For the URL field could this be populated from the actual product URL that appears in the Web Browser Address Bar?

28 Oct 2021, 7:55 AM
#124
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Are you using the GitHub code? If those fields have no data, they should not be generated in the snippets.

While an admin interface for extra fields is not really in the scope of this plugin...I bulk import all those codes with DBIO as they are only done on product creation.
Nonetheless it is no big thing to make an observer for collect_info so anyone can do it and push it to the Github code.

28 Oct 2021, 8:11 AM
#125
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

Are you using the GitHub code? If those fields have no data, they should not be generated in the snippets.

While an admin interface for extra fields is not really in the scope of this plugin...I bulk import all those codes with DBIO as they are only done on product creation.
Nonetheless it is no big thing to make an observer for collect_info so anyone can do it and push it to the Github code.

Yes I am using the GitHub Code....Do you mean the URL and MPN should automatically be created on product creation? If so, this isn't happening or at least google is reporting errors.

Ah ok I forgot about DBIO, I've used this before for similar things.

However it would be good to get them in on product creation from the admin somehow. I will admit though, I've not had to create extra admin fields from scratch. I've always used NUMINIX CUSTOM PRODUCT FIELDS for that purpose. So please can you point me in the direction of field creation from scratch? There are posts on this forum that go through it BUT, they are mostly for earlier versions of Zen Cart. Alot has changed since they were posted so I don't know if they are valid anymore.

I am using CEON SEO URL's as well, so for the URL, I wondered if the CEON field could be used to pull the URL data out into the Structured Data URL field?

28 Oct 2021, 8:31 PM
#126
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Do you mean the URL and MPN should automatically be created on product creation?

No. In the Github code it explains that each shop should add the new columns manually since, depending on the shop, not everyone will use the ean, mpn, isbn etc. columns.
Once the fields are created in the database, they need to be populated with data, using from an import script since manually entering a pile of them would be crazy slow and prone to errors. Still, an admin interface using observers would be appropriate at some point if only to view this data.

The structured data code looks for these fields and only if there is content, generates the snippet containing that data.

Regarding urls, I always use the native url for all external references, never the friendly url, which becomes invalid on a product name update.
Without being interested in stoking the usual arguments over native v.s. friendly urls in a seo context (RIP RodG), I understood it was irrelevant, but I recently read that finally seo weight is being given to friendly urls.

An option could be added to the code to pull those urls from whatever rewriter is in use.

28 Oct 2021, 8:41 PM
#127
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

No. In the Github code it explains that each shop should add the new columns manually since, depending on the shop, not everyone will use the ean, mpn, isbn etc. columns.
Once the fields are created in the database, they need to be populated with data, using from an import script since manually entering a pile of them would be crazy slow and prone to errors. Still, an admin interface using observers would be appropriate at some point if only to view this data.

The structured data code looks for these fields and only if there is content, generates the snippet containing that data.

Regarding urls, I always use the native url for all external references, never the friendly url, which becomes invalid on a product name update.
Without being interested in stoking the usual arguments over native v.s. friendly urls in a seo context (RIP RodG), I understood it was irrelevant, but I recently read that finally seo weight is being given to friendly urls.

An option could be added to the code to pull those urls from whatever rewriter is in use.

Ok I did have a go at adding the extra fields using this method by crazy_chris

https://www.zen-cart.com/showthread.php?57924-How-To-Add-new-Properties-to-your-Products

But the code has changed a little since then and I couldn't get it to populate the necessary fields in the database.

As for the SEO URL's I think it would make sense if the URL could be pulled from the address bar, then it doesn't matter which type of URL is being used.

29 Oct 2021, 3:35 PM
#128
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,967
Plugin Contributions:
8

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

...Regarding urls, I always use the native url for all external references, never the friendly url, which becomes invalid on a product name update...

sorry i am not sure what you mean by invalid.

in ultimate friendly URLs (not sure how the CEON one works), the anchor and the product id are the only relevant data. changing the product name does not render an invalid URL. and it will still return the correct product page as long as those pieces of information are correct.

best.

4 Nov 2021, 11:00 AM
#129
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

How do I get the product URL to Generate in the structured data code please?

This is my code example:

{ "@context": "https://schema.org",
"@type": "Product",
"name": "Brass Plaques and Signs Engraved in the UK",
"image": "https://ventureengravings.uk/images/new-plaques/brass-plaques.jpg",
"description": "Brass Plaques and Signs made to order. Buy now to ensure you receive a great looking plaque.Our Brass Plaques and Signs come with a range fixing options and corner finishes.Choose from a range of popular fonts, or if you have a custom font you would like to use, ask us if we can Engrave it for you.Please Note: All of our Engraved Plaques are measured in inches. And text is always aligned central to the plaque, unless you state otherwise.When you purchase a Brass Plaque through our website, you can enter additional instructions during the checkout process.All spelling must be correct when you submit your specified requirements at time of purchase. Once your Engraving has taken place, corrections will not be possible, so please ensure you check your spelling before sending it to us.",
"sku": "VEBP001",
"weight": "0.101lbs",
"productID": "VEBP001",
"brand": {
"@type" : "Brand",
"name" : "Venture Engravings"
},
"category" : "Brass Plaque Engraving",
"offers" : {
"@type" : "Offer",
"@type" : "AggregateOffer",
"lowPrice" : "0.0000",
"highPrice" : "42.9900",
"offerCount" : "959",
"priceCurrency" : "GBP",
"priceValidUntil" : "2021-12-31",
"itemCondition" : "http://schema.org/NewCondition",
"availability" : "http://schema.org/InStock",
"seller" : "Venture Engravings",
"deliveryLeadTime" : "",
"itemOffered" : "Brass Plaques and Signs Engraved in the UK",
"eligibleRegion" : "ISO 3166-1",
"acceptedPaymentMethod" : {
"@type" : "PaymentMethod",
"name" : ["http://purl.org/goodrelations/v1#Paypal",
"http://purl.org/goodrelations/v1#SquarePay",
"http://purl.org/goodrelations/v1#Mastercard",
"http://purl.org/goodrelations/v1#Visa",
"http://purl.org/goodrelations/v1#AmericanExpress",
"http://purl.org/goodrelations/v1#MaestroPaySwarm",
"http://purl.org/goodrelations/v1#AmericanExpress",
"http://purl.org/goodrelations/v1#DinersClub",
"http://purl.org/goodrelations/v1#Discover",
"http://purl.org/goodrelations/v1#JCB",
"http://purl.org/goodrelations/v1#MasterCard",
"http://purl.org/goodrelations/v1#VISA"]
}
}

It looks like it should appear under "priceValidUntil" but nothing is being generated?

4 Nov 2021, 2:44 PM
#130
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

It looks like it should appear under "priceValidUntil" but nothing is being generated?
Bug. For a product with zen-default attribute-handling.
Fixed on GitHub.

4 Nov 2021, 2:57 PM
#131
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

Bug. For a product with zen-default attribute-handling.
Fixed on GitHub.

Ok so if I just overwrite the files it should fix it then?

4 Nov 2021, 3:16 PM
#132
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

Bug. For a product with zen-default attribute-handling.
Fixed on GitHub.
I've just replaced the files with your new files and I still don't see url in the data? do I need to run the SQL again?

4 Nov 2021, 3:24 PM
#133
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

you should always compare...only the jscript_ changed. Is it on your site yet? I see no change on Brass Plaque Engraving.

4 Nov 2021, 3:33 PM
#134
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

you should always compare...only the jscript_ changed. Is it on your site yet? I see no change on Brass Plaque Engraving.

Thats why I took a backup! Regardless of comparing anyway...it isn't working for me.

I'm downloading from here.

https://github.com/torvista/Zen_Cart-Structured_Data

I've also tried setting the product to 'Product Priced by Attributes: Yes' and still don't see the url.

https://ventureengravings.uk/brass-plaques-and-brass-signs/brass-plaques-and-brass-signs-made-in-the-uk

4 Nov 2021, 5:23 PM
#135
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Are you sure you are using the updated file?
Attachment 19796

4 Nov 2021, 5:35 PM
#136
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

Are you sure you are using the updated file?
Attachment 19796

Yes, I downloaded your files from GitHub

This is what it has in jscript_plugin_structured_data.php

"url": "<?php echo $canonicalLink; ?>",

<?php if ($attribute_lowPrice === $attribute_highPrice) { //or if price not set by attributes, this is already set to base price
4 Nov 2021, 10:39 PM
#137
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

It does not show up in your head. It should be here:
Attachment 19797
Even if the url data was not working, the text "url:" should show....is it in the right template folder?

4 Nov 2021, 10:46 PM
#138
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

It does not show up in your head. It should be here:
Attachment 19797
Even if the url data was not working, the text "url:" should show....is it in the right template folder?

Got it working. I had copied it over in the right directory which is 'bootstrap' but it appears when I copied the folder over and not the file it didn't overwrite jscript_plugin_structured_data.php

Just tried copying 'jscript_plugin_structured_data.php' as an individual file and the url has appeared.

Sorry for the run around on this :-)

7 Nov 2021, 4:21 PM
#139
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

I have made an observer that adds custom fields to the database AND adds those fields to the Admin Product Edit page:

https://github.com/torvista/Zen_Cart-Extra_Product_Fields

8 Nov 2021, 9:48 AM
#140
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

I have made an observer that adds custom fields to the database AND adds those fields to the Admin Product Edit page:

https://github.com/torvista/Zen_Cart-Extra_Product_Fields

Brilliant. Thanks for this, hopefully it will resolve the errors that are being thrown up in search console.