module Analytical module Modules class Google include Analytical::Modules::Base def initialize(options={}) super @tracking_command_location = :head_append end def init_javascript(location) init_location(location) do js = <<-HTML HTML js end end def track(*args) "_gaq.push(['_trackPageview'#{args.empty? ? ']' : ', "' + args.first + '"]'});" end def event(name, *args) data = args.first || nil data_string = data ? ", '#{data.to_json}'" : "" "_gaq.push(['_trackEvent', \"Event\", \"#{name}\"" + data_string + "]);" end end end end