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

Implementing Google Rich Snippets.

Locked

Views: 18,975

Results 1 to 20 of 100
This thread is locked. New replies are disabled.
27 Oct 2009, 9:22 PM
#1
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Implementing Google Rich Snippets.

Has anyone taken a look at coding product reviews in Zen to work with Google's Rich Snippets? It would be cool if Zen could be modified for this.

Jim
Wheaton Website Services

31 Dec 2009, 9:00 PM
#2
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

I too am looking for help with this. Adding Rich snippits to the reviews would be a good thing.
Aany help would be appreciated.

31 Dec 2009, 11:34 PM
#3
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

Thanks for the link but it looks like the link is broken?

31 Dec 2009, 11:39 PM
#4
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Implementing Google Rich Snippets.

wapnoj:

Thanks for the link but it looks like the link is broken?

Hmmm!

Try this without the spaces

googlewebmastercentral .blogspot .com/2009/05/introducing-rich-snippets.html

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

4 Jan 2010, 8:20 PM
#5
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

OK I think if I'm correct the code that needs to be marked up in order to add microformats to the individual reviews is in tpl_product_reviews_info_default.php at line 47 towards the bottom. I can see how to do this in basic HTML but am having trouble with this PHP. any help or advice would be appreciated.

google.com/support/webmasters/bin/answer.py?hl=en&answer=146897

<h1 id="reviewsInfoDefaultHeading"><?php echo $products_name . $products_model; ?></h1> <h2 id="reviewsInfoDefaultPrice" class=""><?php echo $products_price; ?></h2> <h3 class="rating"><?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $review_info->fields['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $review_info->fields['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $review_info->fields['reviews_rating']); ?></h3> <span class="description"><div id="reviewsInfoDefaultMainContent" class="content"><?php echo zen_break_string(nl2br(zen_output_string_protected(stripslashes($review_info->fields['reviews_text']))), 60, '-<br />'); ?></div></span> <div id="reviewsInfoDefaultDate" class="bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($review_info->fields['date_added'])); ?> <?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($review_info->fields['customers_name'])); ?></div>
4 Jan 2010, 8:54 PM
#6
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Implementing Google Rich Snippets.

I'd wrap everything in the following <div>

<div class="hreview">

<h1 id="reviewsInfoDefaultHeading"><span class="item"><?php echo $products_name . $products_model; ?></span></h1> <h2 id="reviewsInfoDefaultPrice" class=""><?php echo $products_price; ?></h2> <h3> <span class="rating"><?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $review_info->fields['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $review_info->fields['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $review_info->fields['reviews_rating']); ?></span></h3> <div id="reviewsInfoDefaultMainContent" class="content"><span class="description"><?php echo zen_break_string(nl2br(zen_output_string_protected(stripslashes($review_info->fields['reviews_text']))), 60, '-<br />'); ?></span></div> <div id="reviewsInfoDefaultDate" class="bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($review_info->fields['date_added'])); ?> <span class="reviewer vcard"> <?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($review_info->fields['customers_name'])); ?></span></div>

</div>

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

4 Jan 2010, 9:45 PM
#7
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

Looks like a great start. Has anyone implemented this yet? I'll give it a try here shortly and post back my results.

I'm unclear on one point here. Will Google show the reviews as part of the SERP for the product page or for the review page for the product?

Jim
Wheaton Website Services

4 Jan 2010, 11:55 PM
#8
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

This is awesome help. Thank you. The description seemed to work great but the other 3 had errors when I use the google rich snippet tool to test
google.com/webmasters/tools/richsnippets

Im getting this result

hreview
reviewer hcard
Warnings : At least one field must be set for Hcard.

rating
Warnings : Rating could not be normalized.
Warnings : Rating is empty.

description = I am purchasing my 3rd set absolutely love it. My main concerns was: is it comfortable? It is so comfortable that you can't tell that you are wearing it.

6 Jan 2010, 1:39 AM
#9
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Implementing Google Rich Snippets.

wapnoj:

This is awesome help. Thank you. The description seemed to work great but the other 3 had errors when I use the google rich snippet tool to test
google.com/webmasters/tools/richsnippets

Im getting this result

hreview
reviewer hcard
Warnings : At least one field must be set for Hcard.

rating
Warnings : Rating could not be normalized.
Warnings : Rating is empty.

description = I am purchasing my 3rd set absolutely love it. My main concerns was: is it comfortable? It is so comfortable that you can't tell that you are wearing it.

wapnoj:

Has anyone had any luck with this?
Thanks

Try this:

<div class="hreview">
<h1 id="reviewsInfoDefaultHeading"><span class="item"><?php echo '<span class="fn">' . $products_name . '</span>' . $products_model; ?></span></h1>
<h2 id="reviewsInfoDefaultPrice" class=""><?php echo $products_price; ?></h2>
<h3>
<?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $review_info->fields['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $review_info->fields['reviews_rating'])), '<span class="rating">' . sprintf(TEXT_OF_5_STARS, $review_info->fields['reviews_rating'] . '</span>'); ?></h3>

<div id="reviewsInfoDefaultMainContent" class="content"><span class="description"><?php echo zen_break_string(nl2br(zen_output_string_protected(stripslashes($review_info->fields['reviews_text']))), 60, '-<br />'); ?></span></div>

<div id="reviewsInfoDefaultDate" class="bold"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_short($review_info->fields['date_added'])); ?> <span class="reviewer vcard">
<?php echo sprintf(TEXT_REVIEW_BY, '<span class="fn">' . zen_output_string_protected($review_info->fields['customers_name']). '</span>'); ?></span></div>

</div>

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

6 Jan 2010, 3:15 AM
#10
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

Looks like everyting is working except the rating. Weh I run it though the google test site

http://www.google.com/webmasters/tools/richsnippets

I get the error:

rating

Warnings : Rating could not be normalized.
Warnings : Rating is empty.

6 Jan 2010, 4:15 AM
#11
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Implementing Google Rich Snippets.

wapnoj:

Looks like everyting is working except the rating. Weh I run it though the google test site

http://www.google.com/webmasters/tools/richsnippets

I get the error:

rating

Warnings : Rating could not be normalized.
Warnings : Rating is empty.

open includes/languages/english/
reviews.php
product_reviews.php
product_reviews_info.php

make sure the following define is in each file

define('TEXT_OF_5_STARS', '%s of 5 Stars!');

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

6 Jan 2010, 7:28 PM
#12
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

clydejones:

open includes/languages/english/
reviews.php
product_reviews.php
product_reviews_info.php

make sure the following define is in each file

define('TEXT_OF_5_STARS', '%s of 5 Stars!');

Thanks I added that define line you suggested to all thre files. They did not have it included however they did have the define line:
define('TEXT_OF_5_STARS', '');

After updating with the define line
define('TEXT_OF_5_STARS', '%s of 5 Stars!')

I retested with the google test poge and recieved the same rating errors as before.

hreview

item fn = widget
reviewer hcard
fn = peggy hobbs
n
family-name = hobbs
given-name = peggy

rating
Warnings : Rating could not be normalized.
Warnings : Rating is empty.

description = Love mine, wouldn't trade it for anything.

6 Jan 2010, 9:15 PM
#13
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Implementing Google Rich Snippets.

wapnoj:

Thanks I added that define line you suggested to all thre files. They did not have it included however they did have the define line:
define('TEXT_OF_5_STARS', '');

After updating with the define line
define('TEXT_OF_5_STARS', '%s of 5 Stars!')

I retested with the google test poge and recieved the same rating errors as before.

hreview

item fn = widget
reviewer hcard
fn = peggy hobbs
n
family-name = hobbs
given-name = peggy

rating
Warnings : Rating could not be normalized.
Warnings : Rating is empty.

description = Love mine, wouldn't trade it for anything.

This might help

Note:Sometimes the rating is included directly in the HTML, but in other cases webmasters often use an image to indicate a rating (for example, an image showing four stars out of five). If your site uses an image to indicate a rating, you should add class="rating" to the image tag. Google will extract the rating from the alt text. For example:

<img class="rating" src="star_rating_sprites.gif" alt="4 Star Rating: Recommended" />

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

6 Jan 2010, 9:28 PM
#14
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Implementing Google Rich Snippets.

Try using this code:

<?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $review_info->fields['reviews_rating'] . '.gif',  sprintf(TEXT_OF_5_STARS, $review_info->fields['reviews_rating']), '', '', 'class="review"') ; ?></h3>

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

6 Jan 2010, 11:45 PM
#15
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

clydejones:

Try using this code:

<?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $review_info->fields['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $review_info->fields['reviews_rating']), '', '', 'class="review"') ; ?></h3>
 
Thanks,  that line does remove rating the error but is also not marked up for google snippets. 
 
So basically no error with this line but also no google preview because google no longer considers it a review.
 
So this will not help in the SERPs which is the main goal.
 
I wish I could figure out how to mark up the ratings section to make this usable.
6 Jan 2010, 11:54 PM
#16
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

wapnoj:

Thanks, that line does remove rating the error but is also not marked up for google snippets.

So basically no error with this line but also no google preview because google no longer considers it a review.

So this will not help in the SERPs which is the main goal.

I wish I could figure out how to mark up the ratings section to make this usable.

Sorry I take that back. I missed your post about the images. I think we might have success. Thank you very much. I'm going to test more.

7 Jan 2010, 12:06 AM
#17
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Implementing Google Rich Snippets.

wapnoj:

Sorry I take that back. I missed your post about the images. I think we might have success. Thank you very much. I'm going to test more.

Ok Try this code:

<?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $review_info->fields['reviews_rating'] . '.gif',  sprintf(TEXT_OF_5_STARS, $review_info->fields['reviews_rating']), '', '', 'class="rating"') ; ?></h3>

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

7 Jan 2010, 12:08 AM
#18
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

wapnoj:

Sorry I take that back. I missed your post about the images. I think we might have success. Thank you very much. I'm going to test more.

AWW I spoke too soon, but I think its close. I'm sure the issue has something to do withthe image situation but not sure how to code that image class into the page.

7 Jan 2010, 12:24 AM
#19
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Implementing Google Rich Snippets.

clydejones:

Ok Try this code:

<?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $review_info->fields['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $review_info->fields['reviews_rating']), '', '', 'class="rating"') ; ?></h3>
 
 
Unfortunetely that line does not seem to define the rating so it still wont produce a preview.
7 Jan 2010, 12:35 AM
#20
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Implementing Google Rich Snippets.

wapnoj:

Unfortunetely that line does not seem to define the rating so it still wont produce a preview.

it should produce the following: (or something similar)

<img src="includes/templates/template_default/images/stars_5.gif" alt="5 of 5 Stars!" title=" 5 of 5 Stars! " width="90" height="20" class="rating" />

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.