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

@blotoutio/providers-google-analytics-4-sdk

Package Overview
Dependencies
Maintainers
1
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blotoutio/providers-google-analytics-4-sdk - npm Package Compare versions

Comparing version 0.10.12 to 0.10.13

120

index.js

@@ -55,84 +55,94 @@ var ProvidersGoogleAnalytics4Sdk = (function () {

const getEvent = (eventName, data, eventId) => {
let event = eventName;
let eventData = data || {};
switch (eventName) {
case 'PageView': {
event = 'page_view';
break;
return {
event: 'page_view',
eventData: {},
};
}
case 'ViewContent': {
event = 'view_item';
eventData = {
currency: data['currency'],
value: data['value'],
items: getItems(data['contents'], data['currency']),
return {
event: 'view_item',
eventData: {
currency: data['currency'],
value: data['value'],
items: getItems(data['contents'], data['currency']),
},
};
break;
}
case 'AddToCart': {
event = 'add_to_cart';
eventData = {
currency: data['currency'],
value: data['value'],
items: getItems(data['contents'], data['currency']),
return {
event: 'add_to_cart',
eventData: {
currency: data['currency'],
value: data['value'],
items: getItems(data['contents'], data['currency']),
},
};
break;
}
case 'InitiateCheckout': {
event = 'begin_checkout';
eventData = {
currency: data['currency'],
value: data['value'],
items: getItems(data['contents'], data['currency']),
return {
event: 'begin_checkout',
eventData: {
currency: data['currency'],
value: data['value'],
items: getItems(data['contents'], data['currency']),
},
};
break;
}
case 'AddShippingInfo': {
event = 'add_shipping_info';
eventData = {
currency: data['currency'],
value: data['value'],
items: getItems(data['contents'], data['currency']),
return {
event: 'add_shipping_info',
eventData: {
currency: data['currency'],
value: data['value'],
items: getItems(data['contents'], data['currency']),
},
};
break;
}
case 'AddPaymentInfo': {
event = 'add_payment_info';
eventData = {
currency: data['currency'],
value: data['value'],
items: getItems(data['contents'], data['currency']),
return {
event: 'add_payment_info',
eventData: {
currency: data['currency'],
value: data['value'],
items: getItems(data['contents'], data['currency']),
},
};
break;
}
case 'Purchase': {
event = 'purchase';
eventData = {
currency: data['currency'],
transaction_id: data['orderId'] || eventId,
value: data['value'],
items: getItems(data['contents'], data['currency']),
return {
event: 'purchase',
eventData: {
currency: data['currency'],
transaction_id: data['orderId'] || eventId,
value: data['value'],
items: getItems(data['contents'], data['currency']),
},
};
break;
}
case 'Search': {
event = 'search';
eventData = {
search_term: data['search'],
return {
event: 'search',
eventData: {
search_term: data['search'],
},
};
break;
}
case 'Lead': {
event = 'generate_lead';
eventData = {
currency: data['currency'],
value: data['value'],
return {
event: 'generate_lead',
eventData: {
currency: data['currency'],
value: data['value'],
},
};
break;
}
default: {
return {
event: eventName,
eventData: data,
};
}
}
return {
event,
eventData,
};
};

@@ -181,3 +191,3 @@ const handleTag = ({ data = {}, eventName, eventId, manifestVariables, }) => {

loaded: isLoaded,
sdkVersion: "0.10.12" ,
sdkVersion: "0.10.13" ,
};

@@ -184,0 +194,0 @@ };

{
"name": "@blotoutio/providers-google-analytics-4-sdk",
"version": "0.10.12",
"version": "0.10.13",
"description": "Google Analytics 4 Browser SDK for EdgeTag",

@@ -5,0 +5,0 @@ "author": "Blotout",

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