crowdstart-analytics
Advanced tools
Comparing version 0.2.6 to 0.2.7
// Generated by CoffeeScript 1.9.3 | ||
var GoogleAnalytics, Integration, parseValue, payload, | ||
var GoogleAnalytics, Integration, parseCurrency, 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,10 @@ hasProp = {}.hasOwnProperty; | ||
parseCurrency = function(value) { | ||
if (typeof value === 'string') { | ||
return value; | ||
} else if (typeof value === 'number') { | ||
return value.toFixed(2); | ||
} | ||
}; | ||
payload = function(opts) { | ||
@@ -69,3 +77,3 @@ var data, k, v; | ||
name: props.name, | ||
price: props.price, | ||
price: parseCurrency(props.price), | ||
quantity: props.quantity, | ||
@@ -214,5 +222,5 @@ variant: props.variant | ||
affiliation: props.affiliation, | ||
revenue: (ref1 = props.total) != null ? ref1 : props.revenue, | ||
tax: props.tax, | ||
shipping: props.shipping, | ||
revenue: parseCurrency((ref1 = props.total) != null ? ref1 : props.revenue), | ||
tax: parseCurrency(props.tax), | ||
shipping: parseCurrency(props.shipping), | ||
coupon: props.coupon | ||
@@ -219,0 +227,0 @@ }); |
{ | ||
"name": "crowdstart-analytics", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
150573
1961