When google indexes a website, it does its best job to try and interpret and categorize the type of data it finds so that it can serve accurate and relevant results to everyone using its search engine.
However, you can greatly enhance google’s accuracy by providing it additional data about your data (i.e. metadata, which is one form of “Rich Snippets”). Doing so can provide the following benefits to you and your users:
- Your target audience will have better odds at finding your content.
- Google will sometimes provide additional information (location, date, and even ticket information) within the actual search result.
- Google will sometimes leverage the location information to boost the result rankings for people searching near the the event area.
In short, its a win-win situation. The website typically gets higher rankings and users are more likely to find informaton that is relevant to their search request.
Google has provided some indepth instructions on how to go about this. For those unfamiliar with coding HTML by hand, you’ll notice that the public facing content doesn’t change at all. All the magic happens through the insertion of additional data within the markup elements themselves. For example, if you typically listed a link to purchase tickets to an event as follows:
<a href="http://www.example.com/events/spinaltap/alltickets">See all available tickets</a> Tickets from $10-$11 2,000 tickets available
You would now wrap each specific component with a new element and specific attributes.
<span rel="v:ticketAggregate"> <div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Offer-aggregate"> Tickets from $<span property="v:lowPrice">10</span>-$ <span property="v:highPrice">11</span> <span property="v:currency">USD</span> <span property="v:offercount">2,000</span> tickets available <a href="http://www.example.com/events/spinaltap/alltickets" property="v:offerurl">See all available tickets</a> </div> </span>
And this is just one component. The full event listing would have several other wrappers to handle location, date, venue, etc. Author’s Note: the example code above was taken directly from the google instructions page
Doing It With Drupal
Obviously doing this by hand would be incredibly tedious. Thankfully there are ways to leverage templating functions within a CMS to generate all this additional markup automatically. With Drupal, one way to do this is to generate the additional pieces of data using preprocessing functions and then injecting it as additional markup by overriding default functions or creating a fully customized output altogether. It is not something that can be done completely out of the box (yet). However, if there is enough interest we will create a followup article with some code we’ve used from our previous projects.