@blotoutio/providers-pinterest-sdk 1.30.2 → 1.31.0
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 +18 -28
- package/index.js +18 -28
- package/index.mjs +18 -28
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -38,33 +38,23 @@ const init = ({ manifest }) => {
|
|
|
38
38
|
window.pintrk('page');
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
case 'SignUp': {
|
|
60
|
-
return 'signup';
|
|
61
|
-
}
|
|
62
|
-
case 'WatchVideo': {
|
|
63
|
-
return 'watchvideo';
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return name;
|
|
67
|
-
};
|
|
41
|
+
const pinterestEventMap = new Map([
|
|
42
|
+
['Purchase', 'checkout'],
|
|
43
|
+
['Checkout', 'checkout'],
|
|
44
|
+
['InitiateCheckout', 'initiatecheckout'],
|
|
45
|
+
['PageView', 'pagevisit'],
|
|
46
|
+
['ViewContent', 'viewcontent'],
|
|
47
|
+
['ViewCategory', 'viewcategory'],
|
|
48
|
+
['AddToCart', 'addtocart'],
|
|
49
|
+
['AddToWishlist', 'addtowishlist'],
|
|
50
|
+
['AddPaymentInfo', 'addpaymentinfo'],
|
|
51
|
+
['Search', 'search'],
|
|
52
|
+
['Lead', 'lead'],
|
|
53
|
+
['SignUp', 'signup'],
|
|
54
|
+
['Subscribe', 'lead'],
|
|
55
|
+
['WatchVideo', 'watchvideo'],
|
|
56
|
+
]);
|
|
57
|
+
const getPinterestEventName = (name) => { var _a; return (_a = pinterestEventMap.get(name)) !== null && _a !== void 0 ? _a : name; };
|
|
68
58
|
const getProductIds = (item, productIdMapping) => {
|
|
69
59
|
var _a, _b;
|
|
70
60
|
if (productIdMapping === '1') {
|
|
@@ -145,7 +135,7 @@ const prepareData = (data, idMapping) => {
|
|
|
145
135
|
return payload;
|
|
146
136
|
};
|
|
147
137
|
const tag = ({ data, eventName, manifestVariables, eventId, executionContext, }) => {
|
|
148
|
-
const result = { sdkVersion: "1.
|
|
138
|
+
const result = { sdkVersion: "1.31.0" };
|
|
149
139
|
if (executionContext.get('pixelFired')) {
|
|
150
140
|
return result;
|
|
151
141
|
}
|
package/index.js
CHANGED
|
@@ -39,33 +39,23 @@ var ProvidersPinterestSdk = (function () {
|
|
|
39
39
|
window.pintrk('page');
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
case 'SignUp': {
|
|
61
|
-
return 'signup';
|
|
62
|
-
}
|
|
63
|
-
case 'WatchVideo': {
|
|
64
|
-
return 'watchvideo';
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return name;
|
|
68
|
-
};
|
|
42
|
+
const pinterestEventMap = new Map([
|
|
43
|
+
['Purchase', 'checkout'],
|
|
44
|
+
['Checkout', 'checkout'],
|
|
45
|
+
['InitiateCheckout', 'initiatecheckout'],
|
|
46
|
+
['PageView', 'pagevisit'],
|
|
47
|
+
['ViewContent', 'viewcontent'],
|
|
48
|
+
['ViewCategory', 'viewcategory'],
|
|
49
|
+
['AddToCart', 'addtocart'],
|
|
50
|
+
['AddToWishlist', 'addtowishlist'],
|
|
51
|
+
['AddPaymentInfo', 'addpaymentinfo'],
|
|
52
|
+
['Search', 'search'],
|
|
53
|
+
['Lead', 'lead'],
|
|
54
|
+
['SignUp', 'signup'],
|
|
55
|
+
['Subscribe', 'lead'],
|
|
56
|
+
['WatchVideo', 'watchvideo'],
|
|
57
|
+
]);
|
|
58
|
+
const getPinterestEventName = (name) => { var _a; return (_a = pinterestEventMap.get(name)) !== null && _a !== void 0 ? _a : name; };
|
|
69
59
|
const getProductIds = (item, productIdMapping) => {
|
|
70
60
|
var _a, _b;
|
|
71
61
|
if (productIdMapping === '1') {
|
|
@@ -146,7 +136,7 @@ var ProvidersPinterestSdk = (function () {
|
|
|
146
136
|
return payload;
|
|
147
137
|
};
|
|
148
138
|
const tag = ({ data, eventName, manifestVariables, eventId, executionContext, }) => {
|
|
149
|
-
const result = { sdkVersion: "1.
|
|
139
|
+
const result = { sdkVersion: "1.31.0" };
|
|
150
140
|
if (executionContext.get('pixelFired')) {
|
|
151
141
|
return result;
|
|
152
142
|
}
|
package/index.mjs
CHANGED
|
@@ -36,33 +36,23 @@ const init = ({ manifest }) => {
|
|
|
36
36
|
window.pintrk('page');
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
case 'SignUp': {
|
|
58
|
-
return 'signup';
|
|
59
|
-
}
|
|
60
|
-
case 'WatchVideo': {
|
|
61
|
-
return 'watchvideo';
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return name;
|
|
65
|
-
};
|
|
39
|
+
const pinterestEventMap = new Map([
|
|
40
|
+
['Purchase', 'checkout'],
|
|
41
|
+
['Checkout', 'checkout'],
|
|
42
|
+
['InitiateCheckout', 'initiatecheckout'],
|
|
43
|
+
['PageView', 'pagevisit'],
|
|
44
|
+
['ViewContent', 'viewcontent'],
|
|
45
|
+
['ViewCategory', 'viewcategory'],
|
|
46
|
+
['AddToCart', 'addtocart'],
|
|
47
|
+
['AddToWishlist', 'addtowishlist'],
|
|
48
|
+
['AddPaymentInfo', 'addpaymentinfo'],
|
|
49
|
+
['Search', 'search'],
|
|
50
|
+
['Lead', 'lead'],
|
|
51
|
+
['SignUp', 'signup'],
|
|
52
|
+
['Subscribe', 'lead'],
|
|
53
|
+
['WatchVideo', 'watchvideo'],
|
|
54
|
+
]);
|
|
55
|
+
const getPinterestEventName = (name) => { var _a; return (_a = pinterestEventMap.get(name)) !== null && _a !== void 0 ? _a : name; };
|
|
66
56
|
const getProductIds = (item, productIdMapping) => {
|
|
67
57
|
var _a, _b;
|
|
68
58
|
if (productIdMapping === '1') {
|
|
@@ -143,7 +133,7 @@ const prepareData = (data, idMapping) => {
|
|
|
143
133
|
return payload;
|
|
144
134
|
};
|
|
145
135
|
const tag = ({ data, eventName, manifestVariables, eventId, executionContext, }) => {
|
|
146
|
-
const result = { sdkVersion: "1.
|
|
136
|
+
const result = { sdkVersion: "1.31.0" };
|
|
147
137
|
if (executionContext.get('pixelFired')) {
|
|
148
138
|
return result;
|
|
149
139
|
}
|