Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

quick push

  • Loading branch information...
commit 9d8266c236b209610329a23396bbc2dbacfe2b53 1 parent dd7e3e9
@robinjfisher authored
View
7 .gitignore
@@ -0,0 +1,7 @@
+.bundle/
+log/*.log
+pkg/
+test/dummy/db/*.sqlite3
+test/dummy/log/*.log
+test/dummy/tmp/
+test/dummy/.sass-cache
View
20 README.rdoc
@@ -1,3 +1,19 @@
-= Touchstone
+Touchstone is a Rails Engine that adds the ability to track advanced metrics for your web app. It is inspired by this post on the Think Vitamin blog: http://thinkvitamin.com/business/marketing/how-to-get-more-customers/
-This project rocks and uses MIT-LICENSE.
+Touchstone consists of 3 elements:
+
+= Campaigns
+A campaign records the details of a source from which visitors will sign up to your website. It can be a Google Adwords campaign or a link on your homepage.
+
+= Campaign Visits
+By adding the parameter ?cid= to each link, the visit will be recorded.
+
+= Campaign Signups
+When a visitor visits your website via a link containing ?cid= and then signs up, the sign up is tied back to that visit and that campaign. You can then track the revenue obtained from each visitor against the cost of a particular campaign.
+
+= Defaults
+By default, Touchstone assumes that you have a Users table but you can amend this (to say reference an Accounts table) by using an initializer:
+
+Touchstone.config do |c|
+ c.association_name = "account"
+end
View
11 db/migrate/create_touchstone_campaigns_signups_table.rb
@@ -0,0 +1,11 @@
+class CreateTouchstoneCampaignSignupsTable < ActiveRecord::Migration
+
+ def change
+ create_table :campaign_signups do |t|
+ t.integer :<%= association_name %>_id
+ t.integer :campaign_id
+ t.timestamps
+ end
+ end
+
+end
View
14 db/migrate/create_touchstone_campaigns_table.rb
@@ -0,0 +1,14 @@
+class CreateTouchstoneCampaignsTable < ActiveRecord::Migration
+
+ def change
+ create_table :campaigns do |t|
+ t.string :name
+ t.text :notes
+ t.date :start_date
+ t.date :end_date
+ t.float :spend_amount
+ t.timestamps
+ end
+ end
+
+end
View
11 db/migrate/create_touchstone_campaigns_visits_table.rb
@@ -0,0 +1,11 @@
+class CreateTouchstoneCampaignVisitsTable < ActiveRecord::Migration
+
+ def change
+ create_table :campaign_visits do |t|
+ t.integer :campaign_id
+ t.string :request_ip
+ t.timestamps
+ end
+ end
+
+end
View
10 lib/touchstone.rb
@@ -1,4 +1,14 @@
require "touchstone/engine"
module Touchstone
+
+ autoload_modules Configuration
+ mattr_accessor :app_root
+
+ class << self
+ def configure &block
+ yield Touchstone::Configuration
+ end
+ end
+
end
View
18 lib/touchstone/configuration.rb
@@ -0,0 +1,18 @@
+require 'singleton'
+module Touchstone
+ module Configuration
+
+ extend self
+
+ attr_accessor :association_name
+
+ def association_name=name
+ @name = name
+ end
+
+ def association_name
+ @name || "user"
+ end
+
+ end
+end
View
11 lib/touchstone/engine.rb
@@ -1,5 +1,16 @@
module Touchstone
class Engine < ::Rails::Engine
isolate_namespace Touchstone
+
+ initialize "team_page.load_app_instance_data" do |app|
+ Touchstone.setup do |config|
+ config.app_root = app.root
+ end
+ end
+
+ initialize "team_page.load_static_assets" do |app|
+ app.middleware.use ::ActionDispatch::Static, "#{root}/public"
+ end
+
end
end
View
11 touchstone.gemspec
@@ -5,12 +5,13 @@ require "touchstone/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
- s.name = "touchstone"
+ s.name = "Touchstone"
s.version = Touchstone::VERSION
- s.authors = ["TODO: Your name"]
- s.email = ["TODO: Your email"]
- s.homepage = "TODO"
- s.summary = "TODO: Summary of Touchstone."
+ s.platfor = Gem::Platform::RUBY
+ s.authors = ["Roin Fisher"]
+ s.email = ["robinjfisher@gmail.com"]
+ s.homepage = "https://github.com/robinjfisher/Touchstone"
+ s.summary = "A Rails Engine that provides metrics for your web app"
s.description = "TODO: Description of Touchstone."
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
Please sign in to comment.
Something went wrong with that request. Please try again.