@artisan-commerce/analytics-web 0.2.0-canary.96 → 0.2.0-canary.98
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/dist/bundle.cjs.js +7 -7
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.esm.js +7 -7
- package/dist/bundle.esm.js.map +1 -1
- package/dist/bundle.umd.js +7 -7
- package/dist/bundle.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/bundle.cjs.js
CHANGED
|
@@ -54,7 +54,7 @@ State$1._instance = null;
|
|
|
54
54
|
|
|
55
55
|
var name = "@artisan-commerce/analytics-web";
|
|
56
56
|
var description = "Artisn commerce analytics web library";
|
|
57
|
-
var version = "0.2.0-canary.
|
|
57
|
+
var version = "0.2.0-canary.97";
|
|
58
58
|
var main = "./dist/bundle.cjs.js";
|
|
59
59
|
var module$1 = "./dist/bundle.esm.js";
|
|
60
60
|
var types = "./dist/bundle.d.ts";
|
|
@@ -87,8 +87,8 @@ var dependencies = {
|
|
|
87
87
|
"snake-case": "^3.0.4"
|
|
88
88
|
};
|
|
89
89
|
var devDependencies = {
|
|
90
|
-
"@artisan-commerce/products": "0.9.0-canary.
|
|
91
|
-
"@artisan-commerce/shopping-cart-core": "0.12.0-canary.
|
|
90
|
+
"@artisan-commerce/products": "0.9.0-canary.61",
|
|
91
|
+
"@artisan-commerce/shopping-cart-core": "0.12.0-canary.92",
|
|
92
92
|
"@artisan-commerce/state": "0.3.0-canary.11",
|
|
93
93
|
"@artisan-commerce/types": "0.14.0-canary.39"
|
|
94
94
|
};
|
|
@@ -428,7 +428,7 @@ class FacebookPixel extends AnalyticsProvider {
|
|
|
428
428
|
initTag.innerText = `!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='${this.version}';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init', '${this.trackingId}');fbq('trackSingle', '${this.trackingId}', 'PageView');`;
|
|
429
429
|
const noScript = document.createElement("noscript");
|
|
430
430
|
noScript.innerHTML = `
|
|
431
|
-
<img height="1" width="1" style="display:none"
|
|
431
|
+
<img height="1" width="1" style="display:none"
|
|
432
432
|
src="https://www.facebook.com/tr?id={${this.trackingId}}&noscript=1"/>
|
|
433
433
|
`;
|
|
434
434
|
document.head.appendChild(linkTag);
|
|
@@ -626,7 +626,6 @@ const initAnalytics = (config) => {
|
|
|
626
626
|
const isServer = typeof window === "undefined";
|
|
627
627
|
if (isServer)
|
|
628
628
|
return;
|
|
629
|
-
State().setState({ initialized: true });
|
|
630
629
|
const { initialized } = State().state;
|
|
631
630
|
if (initialized) {
|
|
632
631
|
logMessage("initAnalytics has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initAnalytics is only called once.", "debug");
|
|
@@ -822,7 +821,7 @@ const checkAnalyticsInitialized = (providers) => {
|
|
|
822
821
|
|
|
823
822
|
const postFacebookConversion = async (config) => {
|
|
824
823
|
const { apiURL, eventName, customData, authToken } = config;
|
|
825
|
-
const { eventSourceUrl } = config;
|
|
824
|
+
const { eventSourceUrl, testCode } = config;
|
|
826
825
|
const { countryISOCode, fbAccessToken, fbPixelId } = config;
|
|
827
826
|
const { platform = "web" } = customData != null ? customData : {};
|
|
828
827
|
const { debug } = State().state;
|
|
@@ -837,7 +836,8 @@ const postFacebookConversion = async (config) => {
|
|
|
837
836
|
countryISOCode,
|
|
838
837
|
customData,
|
|
839
838
|
fbAccessToken,
|
|
840
|
-
fbPixelId
|
|
839
|
+
fbPixelId,
|
|
840
|
+
testCode
|
|
841
841
|
};
|
|
842
842
|
try {
|
|
843
843
|
const data = await fetch(url, {
|