Method: Vanity::Helpers#track!

Defined in:
lib/vanity/helpers.rb

#track!(name, count_or_options = 1) ⇒ Object

Tracks an action associated with a metric. Useful for calling from a Rack handler. Note that a user should already be added to an experiment via #ab_test before this is called - otherwise, the conversion will be tracked, but the user will not be added to the experiment.

Examples:

Vanity.track!(:invitation)
Vanity.track!(:click, { :identity=>Identity.new(env['rack.session']), :values=>[1] })

Parameters:

  • count_or_options (defaults to: 1)

    Defaults to a count of 1. Also accepts a hash of options passed (eventually) to AbTest#track!.

Since:

  • 1.2.0



59
60
61
# File 'lib/vanity/helpers.rb', line 59

def track!(name, count_or_options = 1)
  Vanity.playground.track!(name, count_or_options)
end