@blotoutio/providers-google-analytics-4-sdk
Advanced tools
Comparing version 0.13.0 to 0.14.0
19
index.js
@@ -39,3 +39,3 @@ var ProvidersGoogleAnalytics4Sdk = (function () { | ||
const data = { | ||
item_id: content.id, | ||
item_id: content.id.toString(), | ||
quantity: content.quantity || 1, | ||
@@ -47,3 +47,10 @@ }; | ||
if (content.category) { | ||
data['item_category'] = content.category; | ||
const categories = content.category.split(','); | ||
data['item_category'] = categories[0]; | ||
for (let i = 1; i < Math.min(categories.length, 5); i++) { | ||
if (categories[i].trim()) { | ||
data[`item_category${i + 1}`] = | ||
categories[i].trim(); | ||
} | ||
} | ||
} | ||
@@ -53,2 +60,8 @@ if (content.item_price) { | ||
} | ||
if (content.brand) { | ||
data['item_brand'] = content.brand; | ||
} | ||
if (content.variantId) { | ||
data['item_variant'] = content.variantId.toString(); | ||
} | ||
return data; | ||
@@ -249,3 +262,3 @@ }); | ||
loaded: isLoaded, | ||
sdkVersion: "0.13.0" , | ||
sdkVersion: "0.14.0" , | ||
}; | ||
@@ -252,0 +265,0 @@ }; |
{ | ||
"name": "@blotoutio/providers-google-analytics-4-sdk", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"description": "Google Analytics 4 Browser SDK for EdgeTag", | ||
@@ -5,0 +5,0 @@ "author": "Blotout", |
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
9812
275