diff --git a/README.rdoc b/README.rdoc index 30dbea7..f05dfd7 100644 --- a/README.rdoc +++ b/README.rdoc @@ -24,6 +24,7 @@ Service implementations include: * MixPanel[http://www.mixpanel.com] * Gauges[http://get.gaug.es] * Segment.io[http://segment.io] +* Mouseflow[http://mouseflow.com] == Usage diff --git a/lib/analytical/modules/mouseflow.rb b/lib/analytical/modules/mouseflow.rb new file mode 100644 index 0000000..50350aa --- /dev/null +++ b/lib/analytical/modules/mouseflow.rb @@ -0,0 +1,40 @@ +module Analytical + module Modules + class Mouseflow + include Analytical::Modules::Base + + def initialize(options={}) + super + check_js_url + @tracking_command_location = :body_append + end + + def init_javascript(location) + init_location(location) do + js = <<-HTML + + + HTML + js + end + end + + private + + def check_js_url + if options[:js_url].nil? + raise "You didn't provide a js_url for mouseflow. " + + "Add one to your analytical.yml file so Mouseflow will work." + end + end + + end + end +end \ No newline at end of file