Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crowdstart-analytics

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crowdstart-analytics - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

43

lib/integrations/google-analytics.js
// Generated by CoffeeScript 1.9.3
var GoogleAnalytics, Integration, parseValue,
var GoogleAnalytics, Integration, parseValue, payload,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },

@@ -19,2 +19,17 @@ hasProp = {}.hasOwnProperty;

payload = function(opts) {
var data, k, v;
if (opts == null) {
opts = {};
}
data = {};
for (k in opts) {
v = opts[k];
if (v != null) {
data[k] = v;
}
}
return data;
};
module.exports = GoogleAnalytics = (function(superClass) {

@@ -47,3 +62,3 @@ extend(GoogleAnalytics, superClass);

this.log('GoogleAnalytics.addProduct', arguments);
return ga('ec:addProduct', {
return ga('ec:addProduct', payload({
id: (ref = props.id) != null ? ref : props.sku,

@@ -58,3 +73,3 @@ brand: props.brand,

variant: props.variant
});
}));
};

@@ -64,3 +79,3 @@

this.log('GoogleAnalytics.setAction', arguments);
return ga('ec:setAction', action, props);
return ga('ec:setAction', action, payload(props));
};

@@ -90,3 +105,3 @@

}
return ga('send', 'event', data);
return ga('send', 'event', payload(data));
};

@@ -111,3 +126,2 @@

GoogleAnalytics.prototype.page = function(category, name, props, opts, cb) {
var payload;
if (props == null) {

@@ -123,17 +137,4 @@ props = {};

this.log('GoogleAnalytics.page', arguments);
if (arguments.length === 1) {
name = category;
}
payload = {};
if (opts.page != null) {
payload.page = opts.page;
}
if (opts.title != null) {
payload.title = opts.title;
}
ga('set', payload);
if (opts.location != null) {
payload.location = opts.location;
}
ga('send', 'pageview', payload);
ga('set', payload(opts));
ga('send', 'pageview', payload(opts));
return cb(null);

@@ -140,0 +141,0 @@ };

{
"name": "crowdstart-analytics",
"version": "0.2.5",
"version": "0.2.6",
"description": "Analytics support for Crowdstart.",

@@ -5,0 +5,0 @@ "main": "lib",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc