@blotoutio/providers-facebook-sdk 0.30.0 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +3 -3
- package/index.js +3 -3
- package/index.mjs +3 -3
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -49,10 +49,10 @@ const getProductMappingModel = (productIdMapping, useVariantId) => {
|
|
|
49
49
|
return (value && /^[012]$/.test(value) ? value : '0');
|
|
50
50
|
};
|
|
51
51
|
const getProductId = (productIdMapping, item) => {
|
|
52
|
-
if (productIdMapping === '1') {
|
|
52
|
+
if (productIdMapping === '1' && item.variantId) {
|
|
53
53
|
return item.variantId;
|
|
54
54
|
}
|
|
55
|
-
if (productIdMapping === '2') {
|
|
55
|
+
if (productIdMapping === '2' && item.sku) {
|
|
56
56
|
return item.sku;
|
|
57
57
|
}
|
|
58
58
|
return item.id;
|
|
@@ -123,7 +123,7 @@ const prepareData = (data, productIdMapping) => {
|
|
|
123
123
|
};
|
|
124
124
|
const tag = ({ data, eventName, manifestVariables, eventId }) => {
|
|
125
125
|
const payload = {
|
|
126
|
-
sdkVersion: "0.30.
|
|
126
|
+
sdkVersion: "0.30.1" ,
|
|
127
127
|
};
|
|
128
128
|
if (window.fbq && manifestVariables['enableBrowser'] === '1') {
|
|
129
129
|
const eventData = data['skipTransformation'] === true
|
package/index.js
CHANGED
|
@@ -50,10 +50,10 @@ var ProvidersFacebookSdk = (function () {
|
|
|
50
50
|
return (value && /^[012]$/.test(value) ? value : '0');
|
|
51
51
|
};
|
|
52
52
|
const getProductId = (productIdMapping, item) => {
|
|
53
|
-
if (productIdMapping === '1') {
|
|
53
|
+
if (productIdMapping === '1' && item.variantId) {
|
|
54
54
|
return item.variantId;
|
|
55
55
|
}
|
|
56
|
-
if (productIdMapping === '2') {
|
|
56
|
+
if (productIdMapping === '2' && item.sku) {
|
|
57
57
|
return item.sku;
|
|
58
58
|
}
|
|
59
59
|
return item.id;
|
|
@@ -124,7 +124,7 @@ var ProvidersFacebookSdk = (function () {
|
|
|
124
124
|
};
|
|
125
125
|
const tag = ({ data, eventName, manifestVariables, eventId }) => {
|
|
126
126
|
const payload = {
|
|
127
|
-
sdkVersion: "0.30.
|
|
127
|
+
sdkVersion: "0.30.1" ,
|
|
128
128
|
};
|
|
129
129
|
if (window.fbq && manifestVariables['enableBrowser'] === '1') {
|
|
130
130
|
const eventData = data['skipTransformation'] === true
|
package/index.mjs
CHANGED
|
@@ -47,10 +47,10 @@ const getProductMappingModel = (productIdMapping, useVariantId) => {
|
|
|
47
47
|
return (value && /^[012]$/.test(value) ? value : '0');
|
|
48
48
|
};
|
|
49
49
|
const getProductId = (productIdMapping, item) => {
|
|
50
|
-
if (productIdMapping === '1') {
|
|
50
|
+
if (productIdMapping === '1' && item.variantId) {
|
|
51
51
|
return item.variantId;
|
|
52
52
|
}
|
|
53
|
-
if (productIdMapping === '2') {
|
|
53
|
+
if (productIdMapping === '2' && item.sku) {
|
|
54
54
|
return item.sku;
|
|
55
55
|
}
|
|
56
56
|
return item.id;
|
|
@@ -121,7 +121,7 @@ const prepareData = (data, productIdMapping) => {
|
|
|
121
121
|
};
|
|
122
122
|
const tag = ({ data, eventName, manifestVariables, eventId }) => {
|
|
123
123
|
const payload = {
|
|
124
|
-
sdkVersion: "0.30.
|
|
124
|
+
sdkVersion: "0.30.1" ,
|
|
125
125
|
};
|
|
126
126
|
if (window.fbq && manifestVariables['enableBrowser'] === '1') {
|
|
127
127
|
const eventData = data['skipTransformation'] === true
|