Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
universal-ga
Advanced tools
Readme
A Universal Google Analytics module for node.
Currently supported features:
$ npm install --save universal-ga
To initialize universal-ga
, you will need to first pass in your analytics tracking id.
var analytics = require('universal-ga');
...
analytics.initialize('UA-XXXXX-YYY');
Name | Description |
---|---|
trackingID | string Your analytics tracking id, i.e. UA-XXXXX-YY . |
options.debug | bool (optional) If set to true , will use analytics_debug.js for some additional console logging. |
Before anything else will work, you must first initialize analytics by passing an initial tracking id.
analytics.initialize('UA-12345-12');
Additional options can also be sent to analytics.create
by including them as additional properties on the options object.
analytics.initialize('UA-12345-12', { storage: 'none' });
Name | Description |
---|---|
trackingID | string Another analytics tracking id, i.e. UA-XXXXX-YY . |
options | object or string (optional) additional options to pass to the tracker. |
Allows you to create multiple tracking ids. If you just need to add an additional tracking id, options
can just be the name of your additional tracker. This can be used in combination with the .name()
method.
analytics.initialize('UA-12345-1');
analytics.create('UA-12345-2', 'anotherTracker');
...
analytics.pageview('/home');
analytics.name('anotherTracker').pageview('/home');
However, if you need to combine additional options with a name, you will need to name your tracker as part of the options object.
analytics.initialize('UA-12345-1');
analytics.create('UA-12345-2', {
name: 'anotherTracker',
clientId: generateUUID()
});
This will namespace any additional values, allowing you to specify which values to send to which tracker. The above example would send the following data to analytics:
['send', 'pageview', '/home'],
['anotherTracker.send', 'pageview', 'home']
Name | Description |
---|---|
name | string Send next value for the namespaced tracking id. |
Namespaces the next value that is sent to the tracker.
analytics.name('anotherTracker').pageView('/home');
analytics.name('anotherTracker').timing('load', 'page', 123);
The above would send the following data to analytics:
['anotherTracker.send', 'pageview', '/home'],
['anotherTracker.send', 'timing', 'load', 'page', 123]
Name | Description |
---|---|
key | string Key to send to analytics. |
value | string Value for the key. |
Set key/value pairs for the tracker.
analytics.set('page', '/about');
Name | Description |
---|---|
pagename | string Pagename to send to analytics. |
options | object (optional) Additional options. |
Allows you to send a pageview to analytics. Additional options for the pageview can be seen in the pages documentation.
analytics.pageview('/about');
Name | Description |
---|---|
screenname | string Screenname to send to analytics. |
options | object (optional) Additional options. |
Allows you to send a screenview to analytics. Additional options for the screenview can be seen in the app screens documentation.
analytics.screenview('/about');
Name | Description |
---|---|
category | string Event category. |
action | string Event action. |
options | object (optional) Additional options. |
Allows you to track
Name | Description |
---|---|
category | string Timing category. |
var | string Timing variable. |
value | int Timing value (in milliseconds). |
options | object (optional) Additional options. |
Name | Description |
---|---|
message | string Exception message. |
isFatal | bool Is fatal event. |
Name | Description |
---|---|
key | string Custom dimension/metric key. |
value | string Custom dimension/metric value. |
FAQs
Universal Google Analytics module for node
The npm package universal-ga receives a total of 142 weekly downloads. As such, universal-ga popularity was classified as not popular.
We found that universal-ga 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
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.