Spree Commerce

Try It Now

Tracking E-commerce With Google Analytics

Posted on June 17, 2013 by Wes Ketchum

Google Analytics comes with support for tracking e-commerce right out of the box. All you need to do is some basic configuration and your website will be ready to start gathering data on transactions and items sold. Spree even takes care of adding all the necessary JavaScript and makes the setup as simple as pasting a tracking ID into the Admin section of your store.

  • Google analytics may not work if you are running your app on localhost. See the section titled Testing on localhost here . To get around this try pow if you are using a Mac. Otherwise, it should work fine in production.

Set Up

The first thing you will need to do is set up a Google Analytics account if you do not already have one. Once you have an account you will need to enable e-commerce tracking for your website. This can be accomplished by logging into Google Analytics and following these steps.

1. Click Admin at the top of any screen in Analytics.
2. Use the menu in the Profile column to select the profile you want.
3. Click Profile Settings.
4. Under the Ecommerce Settings section, select Yes, an Ecommerce Site/App.
5. Click Apply.

Now that e-commerce tracking is enabled, it is time to configure your Spree store. Lets start by grabbing the tracking ID inside of Google Analytics. This can be found by clicking on Admin in the top right, and then the Tracking Info tab. The ID will be in the form UA-XXXXXXXX-X. Now go into the Admin section of your Spree store and click on the Configuration tab followed by the Analytics Trackers link at the bottom of the right side navigation. Click on the link to create a new tracker and enter your Google Analytics ID.

  • In older versions of Spree the Configuration screen will look different, however the functionality is all still supported.


Your store is now ready to start tracking e-commerce through Google Analytics. To test that everything is working, walk through the ordering process. Add an item to the cart, click Checkout, and make sure you get all the way to the order confirmation page. Once that is complete, go to Google Analytics and click on the reporting tab. On the left side navigation click on conversions, e-commerce, and then overview. You will see a page similar to the one below outlining some data gathered from your store.

  • Make sure the date filter is set to the current day on your report! The data from your store may not show up in real time. Sometimes you will have to wait a few minutes before you see a transaction.


If you wait for a couple of minutes and still do not see a transaction inside Google Analytics, check to see if these two conditions were met.

  • On the order confirmation page in your Spree store, make sure the Google Analytics JavaScript is present. It should be located at the bottom of the page source and begin with

var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);

If the Javascript is not present, be sure you are still including the spree/shared/google_analytics partial in your application layout.

  • Use the developer tools in your browser to inspect the Spree order confirmation page. On the network tab make sure there is a _utm.gif resource at the bottom of the page. If you do not see that than your data is not being sent to Analytics and is most likely a problem related to using localhost as mentioned previously.

That’s all there is to it. Please leave a comment with any questions or problems. Enjoy!

New Spree Releases to Address Jirafe Issues

Posted on June 13, 2013 by Sean Schofield

As many of you already know, the Spree dashboard (which is powered by Jirafe) has been experiencing outages and other technical problems the past several days. Yesterday, the Jirafe team decide to temporarily shutdown their service for a few weeks while they finish deploying their 2.0 version of the service. This decision was made by Jirafe and without advance consultation with Spree. While we were aware that Jirafe was working on a new version of the service, we had no advance warning of the shutdown.

In some cases the outages have been preventing people from logging into their admin. Given the issues we have been experiencing with Jirafe the past few weeks, our team decided to pull the Jirafe functionality from Spree and issue new emergency patch releases to address the problem. If you are having problems with Jirafe we recommend that you update to one of the following patch releases: 2.0.3, 1.3.3, 1.2.5.

We spoke to the Jirafe team after we received reports of our users getting emails about the shut down. Apparently, the current system has been completely overwhelmed and they reached the difficult conclusion that it was going to be impossible to stand it back up again. We share your frustration at the suddeness of this decision and we apologize for any inconvenience this may cause. The Jirafe team has an excellent product and we’re looking forward to seeing the new version. When Jirafe comes back online again, it will be as an optional extension for Spree and not something that affects the rest of the admin functionality. In the meantime we are working on several alternatives to address your reporting needs.

We’ll have more updates for you shortly.

SpreeConf DC Re-cap

Posted on May 29, 2013 by Lynne Brehmer

Our third SpreeConf was a great success! It was great to be able to get together with Spree users from around the world. This was our largest SpreeConf yet, and everyone loved the fantastic talks and networking opportunities. We are so proud of — and grateful for — our enthusiastic Spree community. It’s what keeps us going and makes Spree so special.

The Sessions

SpreeConf DC included two days of training and talks. The speakers went into depth about their experiences with Spree and provided valuable insights about how to optimize both the technical and business aspects of an e-commerce store. Here are some of the highlights.

Day 1

  • Chris Mar – In Chris’s talk, Fun with Shipments, Chris discussed the new, cutting edge split shipments functionality included in Spree 2.0. We learned how to set up a complex fulfillment situation shipping different types of products from multiple locations based on complicated rules.
  • John Feminella – Gave insight into the future, talking about Better, Faster, Smarter Cloud Deployments with Docker (but then cautioned against using it in production too soon).
  • Peter Berkenbosch – Gave a great introduction to TDD Spree, giving tools, tricks, and examples, creating a real life situation with a breaking test and then walked through fixing it.
  • Denis Ivanov – Perfecting Your E-commerce Frontend using fairly simple improvements; using the best possible CSS selector, minimizing and parallelizing http requests, and using semantic html to improve your visibility on search engine result pages.
  • Eric Koester – Spoke about Capitalizing on the Micro-preneur Revolution, discussing the movement towards freelancing and free agency, including how to be succesful as a free agent.

Day 2

  • Sean Schofield – In discussing Spree 2.0 and Beyond, Sean introduced the crowd to the big changes in Spree 2.0, discussed Spree’s recent accomplishments. Sean also previewed the Rails 4 efforts, the partnership program, upcoming efforts to improve performance, the Spree integrator, and more!
  • Brian Quinn – Brian impressed everybody by Introducing the Spree Integrator, showing how stores and their developers can automatically route order, product, and user events to various endpoints. Brian’s efforts at a live demo were hampered by the wifi issues, but he was able to show detailed examples of what the open source endpoints will look like.
  • Gregor MacDougall and Clarke Brunsdon – talked about Large Scale Migration to Spree: A Case Study, describing how they helped a large store with lots of problems, detailing the process of deciding their migration path, and giving some general migration advice.
  • Ryan Bigg – In Open Source War Stories, we heard about the explosion in Github and User Group activity, some major bumps in the commit graph, and more!
  • Nick Gauthier – Showed off Rails 4 In Action highlighting additions, removals, and improvements, explained the new caching scheme and changes in thread safety, and then took a lot of really good questions about other Rails 4 features.
  • Alex Nemeroff – Hugh & Crye: The (Re)Birth of an Online-only Brand – Gave a thorough look at the opportunities and pitfalls in redesigning and relaunching an e-commerce site. Using Hugh & Crye — a successful menswear brand — as a case study, Alex conveyed the lessons learned from that experience and offered useful takeaways along with a discussion of concrete results.
  • Sandi Metz – Provided lessons from her book Practical Object Oriented Design during her Magic Tricks of Testing talk. She broke unit tests down into 6 categories, and explained how we should test each one.
  • Adil Wali – In Lessons from the Field: Scaling an E-Commerce Business Adil closed out the conference with a thought-provoking look at the state of e-commerce today. He encouraged everyone to think differently about their businesses, disrupt the competition, and accomplish something big.

Ignite SpreeConf Gaming Gala

We hosted the first Ignite SpreeConf Gaming Gala at Stoney’s Upstairs the Sunday evening before the conference. It was a great way for Spree community newcomers to break the ice and for existing community members to reconvene with old friends. We had several tables of River Dragons and Ticket to Ride going. Congrats to our gaming champs – Ted Lilley and Michael Sevestre.

Lightning Talks

This year’s lightning talks, sponsored by Zencoder, were preceded by a cocktail hour which was successful in providing some liquid courage to the lightning talk speakers. The cocktail hour was complete with the legendary SpreeConf whiskey (well, almost complete — our special blend from the Isle of Arran in Scotland was delayed in customs so we had to offer a substitute instead). We had a record number of people sign up for the lightning talks this year including several first time public speakers. Nick Gauthier did an amazing job as MC and kept everyone to the 5 minute time limit. Here’s a photo of most of our lightning talk speakers.

Rails Girls DC Photo and Lunch with Sandi Metz

We set up a special itinerary for Rails Girls DC members which included a photo shoot with Sandi Metz on the morning of Day 2 followed by an off-site lunch. During lunch we had a great group discussion covering topics from how to process the overwhelming amount of information required to stay on top of the latest programming trends to whether the word “girls” should be included in the Rails Girls name. Everyone left really inspired with two or three ideas about how to become a better programmer. We’d like to give a special thanks to Sandi Metz for her support of Rails Girls and Spree. Sandi will be a coach at the Rails Girls DC workshop in June.

Happy Hour

SpreeConf Day 1 concluded with a happy hour at Policy DC sponsored by Braintree. Before the happy hour a group of SpreeConfers ventured to the Washington, DC legendary eatery – Ben’s Chilli Bowl. The happy hour was a buzz with the energy and momentum of the day.

After Party

The SpreeConf after party was held on the rooftop of Lost Society in DC and was sponsored by the Rails Dog team. It was a perfect evening to take in the skyline view of Washington, DC and relax after an intense two days of learning. We really enjoyed the opportunity to get to know all of the SpreeConf attendees better at the party and to learn about your Spree projects.

SpreeConf Photos

We’ve uploaded all of our photos from SpreeConf DC to our Google+ page. Take a look through them when you get a chance and add your own to the gallery.


We’d like to thank all our sponsors for their support of Spree and SpreeConf, especially Contegix, our premier sponsor.

The Next Conference

SpreeConf has become a really valuable opportunity for developers, designers, and store owners to get together and talk about the latest trends in e-commerce and how to make them come to life using the Spree platform. We are so excited by the energy and momentum from this SpreeConf and we can’t wait for the next one! We’d love your suggestions and feedback on where you’d like to have the next SpreeConf and when. In the meantime let’s keep the energy and momentum going. Keep those contributions coming!

Model Translations in Spree internationalization

Posted on May 27, 2013 by Washington L Braga Jr

Coming with the Spree 2.0 release is a brand new version of the Spree internationalization project (spree_i18n). The extension now makes use of the awesome globalize3 gem to allow users to translate records on the main models of a Spree shop.

Currently the following models are supported: Product, Promotion, Property, OptionType, Taxonomy and Taxon. You should see a flag icon on each admin section that supports the feature. Adding a translation to a product name or description is as easy as fill in the fields and submit the form.

The extension also makes good use of globalize3 fallbacks feature. It allows the system to always display content no matter what language the user is viewing the store. If a user is navigating a store in spanish and a product description is not available on that language the app will display the default english translation or whatever content exists for that product description. By the default it searches for translations on the current locale, then on the default and goes on to other locales if available. The idea is never show users a blank page even if there’s no translated record content for the locale they set on the store.

Store managers can control which languages are available to front end users and which should be displayed on the back end translations form inputs through the supported_locales and available_locales configurations respectively. The extension currently includes spree translations for 39 languages. All are listed as options on the Available Locale select box in General Settings section.

The current locale on the store is set through a :locale key on the Rails session object. When using the built in Spree core UI you should see a select box next to the cart link. It sure should be easy enough to customize that to your needs on your Spree store layout.

Check out the README file on the repo for installation instructions and more configuration details. We’re looking forward to getting your feedback!