Spree Extension to send more information to Google Analytics

Last updated on: January 06 at 02:58 PM

source code bug tracker
0 0 1
owner:  acidlabs


Introduction goes here.


Add spree_google_analytics_extras to your Gemfile:

gem 'spree_google_analytics_extras'

Bundle your dependencies and run the installation generator:

bundle exec rails g spree_google_analytics_extras:install


Out of the box this extension will send information to Google Analytics for the following actions

  • View the details of a product (spree/products#show)
  • Add a product to the cart from the product's details view

If in your store you have the option to add products directly from a list of products or from any other page, the add to cart button must have the following attributes

<button class="add-to-cart-button" data-sku="PRODUCT_SKU" data-name="PRODUCT_NAME" data-price="PRODUCT_PRICE"></button>

It can be a button or an a tag or any element that has the add-to-cart-button css class and responds to the click event.


First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app.

bundle exec rake

When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:

require 'spree_google_analytics_extras/factories'

Copyright (c) 2015 [name of extension creator], released under the New BSD License

compatible spree versions
tags spree versions
master ~> 3.0.1
Ignacio Mella