
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Kissable is a gem used to create, track, and store information for A/B tests in user cookies.
Add this line to your application's Gemfile:
gem 'kissable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install kissable
Kissable helps you run A/B tests by breaking up your users into test groups (e.g. Original vs. Variant). Name your test, list your test groups, and the ratio at which people should be distributed to each group. Kissable does the assignment pseudo-randomly.
For anonymous users cookies must be enabled. Cookies are used to assign a user to a group and keep him there. For logged in users a unique identifier (e.g. login) is used instead for the same purpose.
You instantiate the object with these items.
Kissable::AB.new(testname, groups, ratio)
testname
(required) This should be unique per test. It both passes the property to KM tracking as well as helps generate unique user groups for the test.groups
(optional) This is used to name the groups used in the test. It will accept up to four group names. Defaults to %w{Original Variant}
.ratio
(optional) The ratio of how you want users sent to the specified groups. It expects all weightings to equal 100. It defaults to an even weight for all groups in the test.group
and use it to set up a switch in the relevant controller.# home_controller.rb
def index
@ab_test = Kissable::AB.new('top-navigation test')
@users_ab_group = @ab_test.group(cookies)
case @users_ab_group
when 'Original'
render 'index'
else
render 'index-variant'
end
end
#tracking_script
instance method. ab_test = Kissable::AB.new('top-navigation test')
users_ab_group = ab_test.group(cookies)
ab_test.tracking_script(users_ab_group)
ab_test = Kissable::AB.new('top-navigation test')
users_ab_group = ab_test.group(email)
# Add your custom tracking code here.
ab = Kissable::AB.new('some cool test')
ab.group(cookies)
Sinatra handles cookies much differently than Rails. Sinatra stores the cookies which were sent in the request object in request
and the cookies which will be sent back to the user in the response
object. In order to make this as easy as possible, Kissable uses a Sinatra cookie adapter. This adapter needs to be instantiated with the request
and response
objects, then passed to group
.
sca = Kissable::SinatraCookieAdapter.new(request, response)
ab = Kissable::AB.new('some cool test')
users_ab_group = ab.group(sca)
Kissable allows you some potential configurations.
Kissable.configure do |config|
config.logger = Logger.new(STDOUT)
config.domain = '.kissmetrics.com'
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that kissable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.