Spree Commerce

Try It Now

How to Optimize Your Spree Store for Search Engines

Posted on March 07, 2013 by Eric Hochberger

Alarm Grid Home Security is using Spree to build traffic and trust! When we started Alarm Grid, we made the decision that all of our store-building efforts would go toward 1) increasing trust, 2) improving consumer experience, and 3) improving our rankings for important keyword buckets.

Sounds pretty simple, right?

So… First things first, we got our store up and running. After considering all of our options, we settled on… Spree… YIPPEE!

As an SEO consultant who has worked with some pretty big brands, my job has often been to go into companies whose bottom line is doing a-ok and explain to their tech team why what they’re doing is inadequate. You’d be amazed how many Fortune 500 companies don’t have their house in order when it comes to search optimization.

In the case of Spree, so much is done right out of the box, optimizing the site was a delight. I found myself getting to add features in support of SEO rather than asking our technical team to make deletions to the system because some programmer took a terrible shortcut back in the day.

Content Types

Every site has different types of content. A good content baseline would include products and probably some sort of blog. But if you want to improve your SEO ranking using a system driven by content, you can probably think of a lot more content types than just the two.

If you’re not an SEO expert, or haven’t ever wrapped your head around the idea of content types, it’s pretty simple. Google only reads text, so in that sense, all content is the same. But Google categorizes text, so if it can tell that the text is a video transcript, a list of times or details about an event, or information and prices about a product (or even a review about that product which is a different content type entirely), it will treat the content very differently. You can get a good, comprehensive list of content types and everything that Google wants to see within them at schema.org.

Alarm Grid started with products, like any e-commerce store would. Spree handles that pretty well out of the box.

Then, we added product manuals by importing documents from Alarm Grid’s Scribd account using the Scribd API. We then built an entire system in the backend to handle our user’s security FAQs, of which we have collected more than 10,000 (we haven’t answered them all, but we have that many we’re trying to get to). And we extended our products using the official Spree review extension. To date, we have collected more than 100 user-generated reviews. Using YouTube, we uploaded videos to our YouTube channel and then put them up on our site as a new content type. Since Google can’t see or hear what’s in videos, we have gone through the considerable effort of transcribing them, and making sure that our most important videos are surrounded by good content marked up by schema.

Flat URLs and Taxon Design

My philosophy is that URLs should be as short and sweet as possible. I like nested URLs, but they can cause some problems, not to mention that any benefit gained from the signal a nested URL sends to Google can be gained by a good bunch of hyperlinked, on-page breadcrumbs. And in the case of Spree, as you’ll see, a flat URL structure gives you a lot more flexibility as you grow your site into the behemoth you always know it can be.

The result of our flat URL structure is wonderful. My team can move taxons anywhere they want. Which means if a taxon was mis-categorized 8 months ago, I don’t have to worry about re-categorizing it today, because when I move my taxon, the integrity of my URLs is preserved.

The code? Pretty simple thanks to Ruby, class_eval and decorators.

Canonical URLs

Adding a rel=“canonical” to the header of your site will ensure that the URL on your site is appropriately understood by Google. Simply put, Google sees http://www.site.com/subdirectory as an entirely different page than http://www.site.com/subdirectory?=somevariable. Now, sometimes that will be a new page with new content. But at other times that variable is nothing more than information you were trying to extract or preserve. Using the rel=“canonical”, however, you can tell Google that the URLs are to be treated as the same URL.

It’s a little more complicated to patch canonical URLs into Spree. MVC critics may argue with our method, but we set the canonical inside the controllers using filters and output them via an override. Relevant code on gist.

Full-site SSL

We are a security company, so it’s no surprise that we opted to overengineer the security of our own website. Oftentimes, sites will only put SSL in the portions of their site that are taking down credit card information. We went the extra mile and wrapped our entire site in SSL. Google used to have a lot of trouble with SSL. I would never have done this only 2 years ago, but Google is getting better and better, and their capabilities are much better than ever before. We are finding that Google loves SSL. In fact, it’s removed duplicates that the https vs http URLs that not even canonicals could fix. Relevant gist to get Spree to do this.

Duplicate content

Out of the box, Spree needs a little bit of duplicate content cleanup. For example, in the default template, both the homepage and the /products page are exactly the same thing. They display the same products, have the same pagination, and probably the same text. You can get around this in a few ways. The first thing you can do is disable or make inaccessible to crawlers one of the two pages, you can change the homepage so it’s different than the product page, or you can add tons and tons of completely different text to the two pages. Google will read the text, and the fact that they list the same products stops mattering as much. We fixed up our homepage and will soon also be adding content to the taxon pages. If you can help it, you should add as much content to internal pages as you can.

Hope that helps!

We’re not done. We are going to do as much as we can to turn out unique and wonderful, interactive content. We’re not sure what the future holds for our site, but whatever it is, it’s going to be creative, and it’s going to be built with help from Spree.

Anyhow, good luck! We are excited to be members of the Spree family and are happy to continually contribute to the development of our favorite ecommerce system.

Thanks Spree!

Shop the Alarm Grid website and follow them on Twitter and Facebook.