Spree Extension to send more information to Google Analytics
Last updated on: January 06 at 02:58 PM
source code bug trackerIntroduction goes here.
Add spree_google_analytics_extras to your Gemfile:
gem 'spree_google_analytics_extras'
Bundle your dependencies and run the installation generator:
bundle
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
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
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