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.
last-campaign
Advanced tools
Saves campaign query string parameters into a session cookie so they can be retrieved and passed to your marketing automation system when needed.
Saves the last campaign (utm) query string parameters found on the current URL into a session cookie; so that they can be passed to your marketing automation system at any time during the users session.
By default, only utm_campaign
, utm_source
, utm_medium
, utm_content
, and utm_term
are saved. Extra parameters can also be saved by passing them in via the options.params
object. If the query string contains any of the parameters to be saved, a new session is assumed and previously set cookies will be removed.
lastCampaign()
should be called on each page view.
Note: This is currently a browser only module because it reads the query string from window.location.search
and sets cookies via the document.cookie
. It could however, easily be modified to run as an express middleware and work on the server side.
Version 2 of last-campaign by default now sets cookies with a default session timeout of 30 minutes rather than a session cookie.
$ npm install last-campaign
var lastCampaign = require('last-campaign');
lastCampaign();
$ bower install last-campaign
lastCampaign();
timeout
(Number)Default session timeout in minutes. This should match the session timeout used in Google Analyutcs. Default 30
Passing in null
will disable the session timeout and revert to using a session cookie. E.g. timeout: null
prefix
(String)Cookie name prefix. Default ''
params
(Array)An array of additional query string parameters to save. E.g. ['gclid']
.
data
(Object)An object of additional values to save. Values are only saved once per session.
defaults
(Boolean)Specify if the default parameters, utm_campaign
, utm_source
, utm_medium
, utm_content
, and utm_term
should be saved. Default true
domain
(String)Specify a domain to set cookie on. If you want this to work across all of your sub-domains, set this to your domain name prefixed with a period. E.g. .yesware.com
Default null
path
(String)Cookie path.
Default /
gclid
AdWords ID in addition to default parameterslastCampaign({
params: ['gclid']
});
foo
parameter with an _
prefixlastCampaign({
prefix: '_',
defaults: false,
params: ['foo']
});
foo
value in addition to default parameterslastCampaign({
data: {
foo: 'bar'
}
});
Copyright © 2016 Yesware, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Saves campaign query string parameters into a session cookie so they can be retrieved and passed to your marketing automation system when needed.
The npm package last-campaign receives a total of 48 weekly downloads. As such, last-campaign popularity was classified as not popular.
We found that last-campaign 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.