Displaying Star Rating in SERPs with Discourse


(Gulshan Kumar) #1

Displaying star rating with Discourse is easy. I am happy to share, It can be done in simple few steps

Process

  1. Setup Google Tag Manager for your Discourse Application
    image

  2. Add a new HTML Tag containing JSON-LD markup

  3. Filter trigger by page view for particular URL

  4. Publish, wait for 24 hrs to see the result in SERPs.

Thanks


(Mittineague) #2

Interesting. Where are you getting the rating from, Google?


(Gulshan Kumar) #3

Yes, it is Google SERPs. :blush:


(Neil Lalonde) #4

Looks interesting and useful for other types of integrations with tag manager. Can you show what to add in head section of Discourse?


(Gulshan Kumar) #5

Just by editing Theme, I added Tag Manager Script in the </head> section.


(Neil Lalonde) #6

Oh but Discourse has a setting to do that for you. Search settings for GTM.


(Gulshan Kumar) #7

Good to know, we can add GTM script via Settings. Thanks for the hint about better way.
Updated, above quick guide.


(Gulshan Kumar) #8

@neil There is one problem when I add GTM script via Discourse settings, it places inside body.

Expected: It should be in the head.

discourse


Previously, it was recommended by Google to place in the body.
before


But now, they have updated their guidelines: “Paste this code as high in the <head> of the page as possible”.

Can we make this possible?


(Neil Lalonde) #9

Thanks for pointing that out. Yes we should change it to be in the head. Added to my list.


(Kane York) #10

“As high in the <head> as possible”

:roll_eyes: I think they’re just being greedy there. A normal position in the head should be fine.


(Angus McLeod) #11

Depending on the kind of rating you’re after you can also use the ratings plugin, which automatically adds the average rating for a topic as structured data to the topic page html.

Example from a user here: Topic Ratings Plugin


(Neil Lalonde) #12

@Gulshan_Kumar I updated our GTM support today so it adds the code to the head and the body according to the new instructions.