Skip to content

Instantly share code, notes, and snippets.

View ylluminate's full-sized avatar

ylluminate ylluminate

View GitHub Profile

Put this code on the page where the form you want to track resides. Some other examples are currently passed around the web with varying quality. This is one that will work as long as your form tag has an id= or name attribute.

You don´t have to change this code to be able to track form abandonment in your shopping cart, order form or whatever form you want.

This sends events to Google Analytics when a user focuses somewhere not in a field after having focused on a input field. You won´t know for how long users focused on respective fields, or the actual conversion rate in the form using this, but it might be a start.

A tool that provides more insight both over time and per field, is Form Analytics wich helps you optimize your online forms. For instance, it measures dropout rate, average field input length, conversion rate and average time per field. All which provides great insights in the most overlooked, yet important part of you site.

Anyway, here´s the code:

@bbrowning
bbrowning / README
Last active August 29, 2015 14:00
Simple comparison of vanilla Rails app on TorqueBox vs Trinidad
This is in reference to https://plus.google.com/105596541985629444566/posts/27y819XoT2V
to show simple steps I took to try and reproduce the described issue based upon the
information available. This is very simple benchmarking with an almost vanilla Rails 4
application using sqlite as the database so is not useful other than to demonstrate the
out of the box performance with TorqueBox and Trinidad under these situations is very
close.
@aostrega
aostrega / README.txt
Last active August 29, 2015 14:02
Requiring MRI stdlib in Opal
Run `rackup` then visit http://localhost:9292/stuff.js.
@dastels
dastels / gist:ce800d700677b0b3522b
Created June 29, 2014 16:34
rubymotionlisp demo snippet
(main)> Lisp::Initializer.register_builtins
=> #<Lisp::Primitive:0x9490f50 @name="vector" @doc="" @special=false @implementation=#<Proc:0x9490ef0>>
(main)> p = Lisp::Parser.new
=> #<Lisp::Parser:0x9827330>
(main)> p.parse_and_eval("(+ 2 3)").value
=> 5
@jah2488
jah2488 / map_join.md
Created March 20, 2015 05:03
I would like this

I like to manipulate data structures. Sometimes the final out put of that manipulation is a string. So I find myself using the pattern of map + join and its starting to feel like the map + flatten of old. Sadly, ruby does not have an answer for this yet, so this is what I've written in the mean time.

def map_join(arr, sep, &block)
 arr.map(&block).join(sep)
end

map_join([1, 2, 3, 4, 5], '-') { |x| x ** 2 } #=> '1-4-9-16-25'
@RickCarlino
RickCarlino / frequency.rb
Created April 18, 2015 20:48
Ruby Word Frequeuncy Counter. Great for Identifying themes in text / content marketing.
COMMON = %w(the of to and a in is
it you that he was for on
are with as I his they be
at one have this from or had
by hot but some what there we
can out other were all your when
up use word how said an each
she which do their time if will
way about many then them would write
like so these her long make thing
@sproutventure
sproutventure / gist:44466
Created January 7, 2009 21:57
Redmine/Rails email through Gmail SMTP
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
check_auth_args user, secret if user or secret
sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
@ippy04
ippy04 / MailchimpDeliveryMethod
Created March 17, 2011 01:20
Delivery Method for Mailchimp STS and Amazon SES using Uakari
class MailchimpDeliveryMethod
attr_accessor :settings
def initialize(values = {})
self.settings = {:track_opens => true,
:track_clicks => true
}.merge!(values)
end
def deliver!(mail)
@kevinpfromnm
kevinpfromnm / controller.rb
Created June 29, 2011 04:12
example from tagglable hobo plugin (hobo 1.0.x)
autocomplete :new_tag_name do
post = find_instance
items = Tag.find(:all,:conditions => ['name LIKE ?',"%#{params[:query]}%"]).select { |i| i.viewable_by?(current_user) }
items = items - post.tags
render :text => "<ul>\n" +
items.map { |i| "<li>#{i.name}</li>\n" }.join +
"</ul>"
end