README.rdoc in sfanalytics-0.2.1 vs README.rdoc in sfanalytics-0.2.13

- old
+ new

@@ -1,8 +1,49 @@ = sfanalytics SFanalytics provides Google Analytics for your app. Probably only really useful for Ecommerce users of analytics, to provide the functionality to add the order items to your transactions for tracking in Analytics. +== Usage +SFanalytics provides a set of helpers that provide the standard and ecommerce functionality of Google Analytics. + +A simple example of its usage is: + <%- + analytics_add_transaction( { + :id => 'A01', + :store_name => 'TEST STORE', + :total => '3.54', + :vat => '0.34', + :postage => '2.20', + :city => 'Test City', + :county => 'Test County', + :country => 'Test Kingdom' + }, 'UA-1234567-1' + ) + + analytics_add_item( { + :sku => 'TEST123', + :name => 'Test Item', + :category => 'Test Categoru', + :price => '1.99', + :quantity => '2' + }, 'UA-1234567-1' + ) + + analytics_add_item( { + :sku => 'TEST124', + :name => 'Test Item3', + :category => 'Test Categoru', + :price => '1.99', + :quantity => '3' + }, 'UA-1234567-2' + ) + + %> + + <%= analytics_generate('UA-1234566-1') %> + +This adds a transaction, then some line items to the transaction, then outputs the analytics code when analytics_generate is called. Technically the analytics ID is only required on the first helper call, but it does no harm to include it on each call. + == Note on Patches/Pull Requests * Fork the project. * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a