Forums / Strategies for Advertising my Online Store / Implementing Google Rich Snippets.

Implementing Google Rich Snippets.

Locked

Views: 18,975

Results 41 to 60 of 100
This thread is locked. New replies are disabled.
21 Feb 2013, 8:16 PM
#42
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

@Design75 haha.. well thanks for looking anyway!! I still don't have this thing figured out to where I get data found by Google.... but going through all code line-by-line again. I think it is the way/places I have the data put in somehow because I can't find any errors... but like Schoolboy says, one little ' or < or anything can goof the whole thing up;; so I will go through it again..

22 Feb 2013, 8:33 AM
#43
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

I found something. The items highlighted in red below in my tpl_product_info_display.php file are not quotes, but double apostrophe's. In my notepad ++ it is obvious, and they look like this ' ',,, but in Melanie's blog instruction they look like quotes, and on this forum they look exactly like quotes. Do these need to be quotes in order for the snippets to work, or are they correct, being double apostrophe's? On the forum should I be able to tell the difference between the two? is that important? I have gone through my snippets code additions, and I can't find anything,, not one dash or dot missing. I am still getting 'no data detected' when I go here http://www.google.com/webmasters/tools/richsnippets and search https://www.stageandtheaterlighting.com .. I must have something in the wrong order..... ? I guess.... :unsure:

<!--bof Product details list --> <?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?> <ul id="productDetailsList" class="floatingBox back"> <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li><span class="product-info-label">' . TEXT_PRODUCT_MODEL . '</span>' . '<span itemprop="identifier" content="mpn:' . $products_model . '">' . $products_model . '</span></li>' : '') . "\n"; ?> <?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li><span class="product-info-label">' . TEXT_PRODUCT_WEIGHT . '</span>' . $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>' : '') . "\n"; ?> <?php echo (($flag_show_product_info_quantity == 1) ? '<li><span class="product-info-label">'. TEXT_PRODUCT_QUANTITY . ': </span>' . '<span itemprop="quantity">' .$products_quantity . '</span>' .'</li>' : '') . "\n"; ?> <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li><span class="product-info-label">' . TEXT_PRODUCT_MANUFACTURER . '</span>' . '<span itemprop="brand">' .$manufacturers_name . '</span></li>' : '') . "\n"; ?> <?php if ($products_quantity > 0) { ?><li><span itemprop="availability" content="in_stock">In Stock</span></li><?php }?><?php if ($products_quantity == 0) { ?><li><span itemprop="availability" content="out_of_stock">Out of Stock</span></li><?php }?> <li><span itemprop="condition" content="new">New</span></li> <li>Category: <?php echo '<span itemprop="category" content="' . $categories->fields['categories_name'] . '">' . $categories->fields['categories_name'] ; ?></li> </ul> <br class="clearBoth" /> <?php } ?> <!--eof Product details list -->
22 Feb 2013, 9:39 AM
#44
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Implementing Google Rich Snippets.

Johnnycopilot:

I believe that I have fixed change #9, but Google structured Data Testing tool still showing 'no date' on my site. Does anyone see any other errors that may be causing this.... as far as what schoolboy told me, I changed to this.. Thanks!!!!! :smile:

"availability" content="out_of_stock">Out of Stock</span></li><?php }?>

<li><span itemprop="condition" content="new">New</span></li> <li>Category: <?php echo '<span itemprop="category" content="' . $categories->fields['categories_name'] . '">' . $categories->fields['categories_name'] ; ?></li> </ul> <br class="clearBoth" /> <?php } ?> <!--eof Product details list -->

I believe this is missing the span closing tag. This is what i did to close the tag on my own site

<li>Category: <?php echo '<span itemprop="category"  content="' . $categories->fields['categories_name'] . '">' .  $categories->fields['categories_name'] . '</span>' ; ?></li>
22 Feb 2013, 1:42 PM
#45
rizla avatar

rizla

Zen Follower

Join Date:
Sep 2010
Posts:
449
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

Interesting post...

Just how difficult would it be to impliment this on v 1.3.9.h using Melanie's solution?

or are they similar?

Thanks

22 Feb 2013, 2:01 PM
#46
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Implementing Google Rich Snippets.

Rizla:

Interesting post...

Just how difficult would it be to impliment this on v 1.3.9.h using Melanie's solution?

or are they similar?

Thanks

It should be pretty similar. All the same items are there. It is more a template difference, since different templates may place the blocks of code in a different location

22 Feb 2013, 9:49 PM
#47
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

Design75:

I believe this is missing the span closing tag. This is what i did to close the tag on my own site

<li>Category: <?php echo '<span itemprop="category" content="' . $categories->fields['categories_name'] . '">' . $categories->fields['categories_name'] . '</span>' ; ?></li> ```

Thanks Design75, I appreciate your help; I added the closing span tag, but I am still getting "Extracted structured data - No Data Detected". I wonder why that closing tag is not on Melanie's site; perhaps because it is at the last bit of code before <!--eof Product details list --> , and just being there closes it? I obviously don't know anything about php. The code/snippets I have added, and I have added everything in her list, has not caused anything not to work... so I am going to leave it in there for now. I have backups if I need to put original pages back.

perhaps I am using the tool wrong? the link is here..
http://www.google.com/webmasters/tools/richsnippets I mean, I don't really see any way to use it wrong.. I just enter my URL........

I am not getting the traffic that I should be getting from the search engines, and I want to do all I can to help generate that traffic; but I am hitting a brick wall with these snippets as of now..

23 Feb 2013, 9:15 PM
#48
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Implementing Google Rich Snippets.

I am getting the same thing as the OP. I am experienced with making changes to code and when comparing my page source to Melanie's example in her blog post (the outdoor lighting site) everything is the same in terms of where the new microtags should be. When I paste in the relevant parts of the html from the page source into the html test on the validator page it shows up ok, but when doing a url nothing is found. I don't know where I am going wrong.


Zen Cart and it's community are the best!!

23 Feb 2013, 9:46 PM
#49
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Implementing Google Rich Snippets.

OK, just added this to a different site and it's working. So, there is something in my original site's template that is making this not work but I don't know what it may be yet. Perhaps if the OP can list his add-ons I can compare it to what are unique to my original site vs my new site and see if there is something that matches.


Zen Cart and it's community are the best!!

23 Feb 2013, 10:07 PM
#50
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Implementing Google Rich Snippets.

I made a slight change to the code so there doesn't have to be two list items, one saying "xx units in stock" and the next one saying "in stock". Seemed kind of redundant and wasting space, as well as not too smooth/polished/professional. I tested it and it still validates fine with the structured data testing tool.

All of these changes are in the tpl_product_info_display file.

Omit the new snippet for the in_stock/out_of_stock check:

<?php if ($products_quantity > 0) { ?><li><span  itemprop="availability" content="in_stock">In  Stock</span></li><?php }?><?php if  ($products_quantity == 0) { ?><li><span  itemprop="availability" content="out_of_stock">Out of  Stock</span></li><?php }?>

and instead change this code(shown with Melanie's change adding the microtag)

<?php echo (($flag_show_product_info_quantity == 1) ? '<li>'. '<span itemprop="quantity">' . $products_quantity . '</span>' . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>

to this

<?php if ($products_quantity > 0) { ?>
  <?php echo (($flag_show_product_info_quantity == 1) ? '<li>'. '<span itemprop="quantity">' . $products_quantity . '</span>' . '<span itemprop="availability" content="in_stock">' .TEXT_PRODUCT_QUANTITY . '</span></li>'  : '') . "\n"; ?>
  <?php }?>
  <?php if ($products_quantity == 0) { ?>
  <li><span itemprop="availability" content="out_of_stock">Out of Stock</span></li>
<?php }?>


Zen Cart and it's community are the best!!

24 Feb 2013, 11:04 AM
#51
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

lankeeyankee:

I made a slight change to the code so there doesn't have to be two list items, one saying "xx units in stock" and the next one saying "in stock". Seemed kind of redundant and wasting space, as well as not too smooth/polished/professional. I tested it and it still validates fine with the structured data testing tool.

All of these changes are in the tpl_product_info_display file.

Omit the new snippet for the in_stock/out_of_stock check:

<?php if ($products_quantity > 0) { ?><li><span itemprop="availability" content="in_stock">In Stock</span></li><?php }?><?php if ($products_quantity == 0) { ?><li><span itemprop="availability" content="out_of_stock">Out of Stock</span></li><?php }?>
> 
> and instead change this code(shown with Melanie's change adding the microtag)
> ```php
<?php echo (($flag_show_product_info_quantity == 1) ? '<li>'. '<span itemprop="quantity">' . $products_quantity . '</span>' . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>

to this

<?php if ($products_quantity > 0) { ?> <?php echo (($flag_show_product_info_quantity == 1) ? '<li>'. '<span itemprop="quantity">' . $products_quantity . '</span>' . '<span itemprop="availability" content="in_stock">' .TEXT_PRODUCT_QUANTITY . '</span></li>' : '') . "\n"; ?> <?php }?> <?php if ($products_quantity == 0) { ?> <li><span itemprop="availability" content="out_of_stock">Out of Stock</span></li> <?php }?> ```

Much neater... When I was busy on my own version of what Melanie accomplished (the reason I abandoned my effort), I did the in_stock element just as you have done.

20 years a Zencart User

25 Feb 2013, 7:25 AM
#52
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: Implementing Google Rich Snippets.

I've just tried Melanie's implementation but Google's Structured Data Testing Tool couldn't pull the image.

It seems Data Highlighter, once Google expands it to data types other than event, i.e. products in my case, will be an even easier way to do it.

26 Feb 2013, 1:22 AM
#53
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

lankeeyankee:

I made a slight change to the code so there doesn't have to be two list items, one saying "xx units in stock" and the next one saying "in stock". Seemed kind of redundant and wasting space, as well as not too smooth/polished/professional. I tested it and it still validates fine with the structured data testing tool.

Thanks. I believe that I need both fields because they serve different purposes for me;; For example, if I put 0 in the qty in stock field, and have product marked 'in stock', my product still shows up on the website and says 'sold out' instead of 'add to cart'. If I put 'out of stock', product disappears from website. Sometimes I will add a product, get the description, photo, etc. set up, but I may be waiting on a manufacturer price update, or I may try to attract a customer to my store looking for that particular product, even though I don't have a price yet, and I want product displayed; so I mark 'in stock' and product qty '0'. Then I can easily go back and 'view all products', scan with my eyes to see which products say 'sold out', and then I know which products need me to 'finish' the descriptions, or price,, etc.. I don't believe I could do that if the fields were combined. That is, if I understand what you have done. Does that make sense, or do I not understand what you have done?

Also, I still can't get any google snippets working. I may contact Melanie via her blog and see if she will be interested in installing the for me. Thanks for all of the help, but I suppose I simply don't know enough about code yet. I will keep trying for a little longer!! ha

26 Feb 2013, 1:26 AM
#54
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

Thannaree:

I've just tried Melanie's implementation but Google's Structured Data Testing Tool couldn't pull the image.

It seems Data Highlighter, once Google expands it to data types other than event, i.e. products in my case, will be an even easier way to do it.

Thanks for the reply. Do you mind elaborating on Data Highlighter? I will Google it, but I would really be interested in anything that you have to say about it as well. :smile:

26 Feb 2013, 2:28 AM
#55
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: Implementing Google Rich Snippets.

You can find it under your Google’s Webmaster Tools. Here's a link to a blog post that explains how it works.

http://techcrunch.com/2012/12/12/google-data-highlighter/

26 Feb 2013, 2:59 AM
#56
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

Thannaree:

You can find it under your Google’s Webmaster Tools. Here's a link to a blog post that explains how it works.
http://techcrunch.com/2012/12/12/google-data-highlighter/
Thanks, I checked it out a little. I suppose that will only work for Google..? which is very important no doubt. Google must make a 'note' in their database about your page, and reference those notes when someone searches..? That will definitely be nice when Google moves it into other areas with it, such as products, if they ever do. Google often comes up with new 'ideas', only to change them within a year or two. I have fallen victim to that before... and in this particular case, the fact that this is mainly for events,,, that, to me, seems like a 'current' type thing.. in other words, no need to wait for the google cache to post. Like the news instant feeds, but for the average user...?? ..but then again, I have been out of the loop so long I really don't know very much about seo. That being said, I want to get my site 'right'... internally.. There are other search engines out there that do provide a certain amount of traffic, and I want my websites data to be embedded with the proper tags for all search engines. I have not given up on this Google Snippets code... which brings up a question... I was told that other search engines (other than Google) will recognize these 'snippets'... is that the case? or are these snippets proprietary to Google?

Does anyone have any idea why my snippets code is not working? If anyone runs into Melanie in another blog, would you kindly ask her to take a look at this post? Thanks!! :D

26 Feb 2013, 4:30 AM
#57
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Implementing Google Rich Snippets.

Johnnycopilot:

Does anyone have any idea why my snippets code is not working?
See my earlier post. I think on my site it has something to do with a modification I made to the site. What add-ons and code modifications have you done? I will see if our sites use one (or more) in common to try to eliminate the possibilities. I have it working on one site but not the other, which is super heavily modified. My guess off the top of my head is it's JS related since it validates when I paste the relevant HTML off my page source into the HTML validator part of their site.


Zen Cart and it's community are the best!!

26 Feb 2013, 6:29 AM
#58
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

lankeeyankee:

See my earlier post. I think on my site it has something to do with a modification I made to the site. What add-ons and code modifications have you done? I will see if our sites use one (or more) in common to try to eliminate the possibilities. I have it working on one site but not the other, which is super heavily modified. My guess off the top of my head is it's JS related since it validates when I paste the relevant HTML off my page source into the HTML validator part of their site.

Thanks :) Here is what I have done lankeeyankee. If I can think of anything else I will post it. What do you mean "JS" related?

I have added the following plugins

  1. apsona shopadmin
  2. colums instead of rows SNAF .. which required a few things added to my CSS in order to make the pictures 'line up' for lack of a better word. I took spaces out? maybe? I can look it up if you need that info.
  3. Lightbox ADD on for Zen cart
  4. MAP Pricing v1.5.zip
  5. jw player (which I don't use anymore; but I believe it's just a single folder added to the root)

Templates installed (I am using abagon)

  1. a_modern_zen_1-1-2
  2. aBagon Zen Cart
  3. Black Zen
  4. Cold Steel

CSS Changes

  1. changed my body wrapper tags to make site % instead of fixed width
  2. change to bring text to the top on showbook page
  3. take cell padding out of products (categories) page so that SNAF works (listed in #2 above)
  4. .listingDescription+br, .listingDescription+br+br, .listingDescription+br+br+br {display: none;} to take space out between description and add to cart box
  5. Changed the display of the M.A.P. pricing.. my thread is here about that one ... http://www.zen-cart.com/showthread.php?205843-MAP-Pricing-v1-5-display-strike-through-on-MAP-Price

I changed some display text in some of the php files.. just a few words here and there.. no code changes there

Do you want a copy of any of my files? I will be glad to attach them...

Thanks, and if you need to know anything else, please let me know. Thanks!!

26 Feb 2013, 1:32 PM
#59
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

Johnnycopilot:

Does anyone have any idea why my snippets code is not working?

Call up one of your Product Info pages, then look at the page source code (html) and assess whether the micro-data tags are being referenced properly.

If not, then something "custom" on your site is generating the final HTML in a way that "ignores" the snippet embeds indicated by Melanie.

20 years a Zencart User

26 Feb 2013, 1:45 PM
#60
rizla avatar

rizla

Zen Follower

Join Date:
Sep 2010
Posts:
449
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

Could anyone give me a pointer?

Just done the edits on v1.3.9h
Seems to be working but on Google test it shows my currency as USD and I'm UK

Checked the Admin settings and can't find (or missed) anything obvious.

Where should I be checking?

Thanks