*

morfik

  • ****
  • 169 posts
Google microdata and ratings
« on: February 21, 2023, 12:06:45 PM »
There's a way to enable generating micro data for google, facebook, twitter in the Oslcass settings. This adds also the rating to the posted listing. Unfortunately when no one rated the listing yet, it shows 0/5 (instead of some text like "not rated yet"). I think this should be fixed because if you use this option, everyone will see in the google search that your listing is very badly rated.

*

MB Themes

Re: Google microdata and ratings
« Reply #1 on: February 21, 2023, 09:11:01 PM »
How can you tell google that product is not rated?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Google microdata and ratings
« Reply #2 on: February 21, 2023, 09:18:32 PM »
I see it in google search results. Also there are issues with this rating on google search console. And it threats this as really bad warning preventing the ad to be visible in google search if someone reports it. So I disabled this generated microdata for now.
« Last Edit: February 21, 2023, 09:23:52 PM by morfik »

*

morfik

  • ****
  • 169 posts
Re: Google microdata and ratings
« Reply #3 on: February 22, 2023, 12:33:29 AM »
I think I know where the problem is:

Code: [Select]
"ratingValue": "<?php echo round(osc_count_item_comments_rating(), 1); ?>",
This returns 0 when there's no comments. And that's why Google shows 0 in its rating.

When I posted a coment and rated 5, it showed 5. So something is clearly wrong here.

*

MB Themes

Re: Google microdata and ratings
« Reply #4 on: February 24, 2023, 09:15:52 PM »
@morfik
Then google will start complain you are missing these micro data.
There is no ultimate solution, google is wrong and require rating even there is no rating.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Google microdata and ratings
« Reply #5 on: February 24, 2023, 09:28:40 PM »
Yes, I know, I see the warnings, but having 0/1 rating on every listing is really bad. I don't remember, but when I was using Wordpress long time ago, it didn't have this issue with 0/1 rating. It simply said no reviews/ratings yet.

So maybe it would be better to print 5 instead of 0 where there's no comments/ratings? What's the clever way of doing it?
« Last Edit: February 24, 2023, 09:31:02 PM by morfik »

*

MB Themes

Re: Google microdata and ratings
« Reply #6 on: February 25, 2023, 01:32:34 PM »
@morfik
That's even worse.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Google microdata and ratings
« Reply #7 on: February 25, 2023, 01:40:08 PM »
Why? It would be showed in google as 5 instead of 0, why is this worse? We can assume that admin likes all the ads equally and gives them 5 after they were posted.  ;)

*

MB Themes

Re: Google microdata and ratings
« Reply #8 on: February 25, 2023, 02:05:43 PM »
@morfik
Because you provide false data to google just to make your site looks better.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Google microdata and ratings
« Reply #9 on: February 25, 2023, 02:07:49 PM »
But if it's 0, it also provides false data to google... If I had to choose, I would stick with 5. So how to change it?

*

MB Themes

Re: Google microdata and ratings
« Reply #10 on: February 25, 2023, 02:17:33 PM »
Core or item.php
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Google microdata and ratings
« Reply #11 on: February 25, 2023, 02:30:50 PM »
I'm not a programmer, so what should be put instead of:

"ratingValue": "<?php echo round(osc_count_item_comments_rating(), 1); ?>",

Basically how to compose a condition like:

if there's no comments, print 5,  else print what should be printed  8)
« Last Edit: February 25, 2023, 02:33:25 PM by morfik »

*

MB Themes

Re: Google microdata and ratings
« Reply #12 on: February 25, 2023, 05:26:28 PM »
osc_count_item_comments_rating() > 0 ? osc_count_item_comments_rating() : 5
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Google microdata and ratings
« Reply #13 on: February 25, 2023, 06:33:46 PM »
I have no idea how to rewrite the following line  ;)

Code: [Select]
"ratingValue": "<?php echo round(osc_count_item_comments_rating(), 1); ?>",
in

Code: [Select]
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "<?php echo round(osc_count_item_comments_rating(), 1); ?>",
    "bestRating": "5",
    "worstRating": "0",
    "ratingCount": "<?php echo (osc_count_item_comments() > osc_count_item_comments() : 1); ?>",
    "reviewCount": "<?php echo (osc_count_item_comments() > osc_count_item_comments() : 1); ?>"
  }

*

MB Themes

Re: Google microdata and ratings
« Reply #14 on: February 26, 2023, 10:47:25 AM »
osc_count_item_comments_rating() > 0 ? osc_count_item_comments_rating() : 5

Its there. Or its different question?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots