Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
SNOGmetrics is a bridge between Rails and KISSmetrics' JavaScript API.
Yes, but it's not as good as the JavaScript one, they even say so themselves:
One thing to note about the Ruby API is that it is not as full featured as the JavaScript client. Therefore, in most cases we recommend using the JavaScript client. However, some things are easier to track server-side, therefore we have provided a basic Ruby client.
It's true, but why settle for either or?
SNOGmetrics works similarly to flash messages. Events are recorded and saved to the session, and are then sent when the next page is rendered. This way you get all of the benefits of the JavaScript API, but you can record events in your controllers. All you have to do is install this gem, configure it, and add a snipplet of code to your layout.
Add snogmetrics
in your gemfile and run the bundle command to install it
Add an initializer file like the following under your config/initializers folder
Snogmetrics.kissmetrics_api_key = "your-api-key-here"
Edit your layout(s) and add <%= km.js! %>
in the body tag (this makes it work nicely with Turbolinks)
Replace all your KM.record(...)
and KM.identify(...)
calls in JavaScript with calls to km.record(...)
and km.identify(...)
Have a look at the included example application to see it in action.
Yes it does.
Just do it. You need to make sure that the _kmq
array exists, though. SNOGmetrics will define it where you place <%= km.js! %>
, but that is usually at the bottom of the page (with the async API you could probably put it at the top if you wanted to), so if you want to add things to _kmq
before that you need to define it yourself. Just add var _kmq = _kmq || []
and you're set.
SNOGmetrics implements #set, which is equivalent to _kmq.push(["set", ...])
, the preferred way of recording which version a user saw in an A/B test. SNOGmetrics does not support the KM.ab
function, because that's something you want to do in JavaScript only.
Yes, SNOGmetrics will not output the KISSmetrics API code unless RAILS_ENV
is production
by default. Instead it will output code that logs all calls to the console (if console
is defined).
If you'd like to change this behaviour, add the following to your initializer:
Snogmetrics.output_strategy = :live
Copyright (c) 2010 Theo Hultberg / Burt. See LICENSE for details.
FAQs
Unknown package
We found that snogmetrics 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.