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

@mparticle/web-google-analytics-kit

Package Overview
Dependencies
Maintainers
10
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mparticle/web-google-analytics-kit - npm Package Compare versions

Comparing version 2.1.9 to 2.1.10

5

CHANGELOG.md
## Releases
--
- fix: Set custom dimensions for product impressions
#### 2.1.10 - 2021-04-26
- Refactor variable declaration for attrName
#### 2.1.9 - 2020-12-10

@@ -5,0 +8,0 @@ - Refactor variable declaration for attrName

50

dist/GoogleAnalyticsEventForwarder.common.js

@@ -20,3 +20,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

moduleId = 6,
version = '2.1.9',
version = '2.1.10',
MessageType = {

@@ -221,11 +221,22 @@ SessionStart: 1,

function addEcommerceProductImpression(product) {
ga(createCmd('ec:addImpression'), {
function addEcommerceProductImpression(product, updatedProductDimentionAndMetrics) {
var productAttrs = {
id: product.Sku,
name: product.Name,
type: 'view',
category: product.Category,
brand: product.Brand,
variant: product.Variant
});
variant: product.Variant,
price: product.Price,
coupon: product.CouponCode,
quantity: product.Quantity,
type: 'view'
};
for (var attr in updatedProductDimentionAndMetrics) {
if (updatedProductDimentionAndMetrics.hasOwnProperty(attr)) {
productAttrs[attr] = updatedProductDimentionAndMetrics[attr];
}
}
ga(createCmd('ec:addImpression'), productAttrs);
}

@@ -252,3 +263,5 @@

impression.ProductList.forEach(function(product) {
addEcommerceProductImpression(product);
var updatedProductDimentionAndMetrics = {};
applyCustomDimensionsMetricsForSourceAttributes(product.Attributes, updatedProductDimentionAndMetrics, productLevelMap);
addEcommerceProductImpression(product, updatedProductDimentionAndMetrics);
});

@@ -493,3 +506,2 @@ });

} else {
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

@@ -564,3 +576,3 @@ }

isInitialized = true;
if (window.mParticle.getVersion().split('.')[0] === '2') {

@@ -635,3 +647,3 @@ onUserIdentified(mParticle.Identity.getCurrentUser());

if (!config) {
window.console.log('You must pass a config object to register the kit ' + name);
console.log('You must pass a config object to register the kit ' + name);
return;

@@ -641,3 +653,3 @@ }

if (!isObject(config)) {
window.console.log('\'config\' must be an object. You passed in a ' + typeof config);
console.log('\'config\' must be an object. You passed in a ' + typeof config);
return;

@@ -656,11 +668,13 @@ }

}
window.console.log('Successfully registered ' + name + ' to your mParticle configuration');
console.log('Successfully registered ' + name + ' to your mParticle configuration');
}
if (window && window.mParticle && window.mParticle.addForwarder) {
window.mParticle.addForwarder({
name: name,
constructor: constructor,
getId: getId
});
if (typeof window !== 'undefined') {
if (window && window.mParticle && window.mParticle.addForwarder) {
window.mParticle.addForwarder({
name: name,
constructor: constructor,
getId: getId
});
}
}

@@ -667,0 +681,0 @@

{
"name": "@mparticle/web-google-analytics-kit",
"version": "2.1.9",
"version": "2.1.10",
"author": "mParticle Developers <developers@mparticle.com> (https://www.mparticle.com)",

@@ -5,0 +5,0 @@ "description": "mParticle integration sdk for Google Analytics",

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