@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.
@@ -52,7 +52,7 @@
52
52
 
53
53
  var name = "@artisan-commerce/analytics-web";
54
54
  var description = "Artisn commerce analytics web library";
55
- var version = "0.2.0-canary.95";
55
+ var version = "0.2.0-canary.97";
56
56
  var main = "./dist/bundle.cjs.js";
57
57
  var module = "./dist/bundle.esm.js";
58
58
  var types = "./dist/bundle.d.ts";
@@ -85,8 +85,8 @@
85
85
  "snake-case": "^3.0.4"
86
86
  };
87
87
  var devDependencies = {
88
- "@artisan-commerce/products": "0.9.0-canary.60",
89
- "@artisan-commerce/shopping-cart-core": "0.12.0-canary.91",
88
+ "@artisan-commerce/products": "0.9.0-canary.61",
89
+ "@artisan-commerce/shopping-cart-core": "0.12.0-canary.92",
90
90
  "@artisan-commerce/state": "0.3.0-canary.11",
91
91
  "@artisan-commerce/types": "0.14.0-canary.39"
92
92
  };
@@ -426,7 +426,7 @@ ${key}: ${value}`;
426
426
  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');`;
427
427
  const noScript = document.createElement("noscript");
428
428
  noScript.innerHTML = `
429
- <img height="1" width="1" style="display:none"
429
+ <img height="1" width="1" style="display:none"
430
430
  src="https://www.facebook.com/tr?id={${this.trackingId}}&noscript=1"/>
431
431
  `;
432
432
  document.head.appendChild(linkTag);
@@ -624,7 +624,6 @@ ${key}: ${value}`;
624
624
  const isServer = typeof window === "undefined";
625
625
  if (isServer)
626
626
  return;
627
- State().setState({ initialized: true });
628
627
  const { initialized } = State().state;
629
628
  if (initialized) {
630
629
  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");
@@ -820,7 +819,7 @@ ${key}: ${value}`;
820
819
 
821
820
  const postFacebookConversion = async (config) => {
822
821
  const { apiURL, eventName, customData, authToken } = config;
823
- const { eventSourceUrl } = config;
822
+ const { eventSourceUrl, testCode } = config;
824
823
  const { countryISOCode, fbAccessToken, fbPixelId } = config;
825
824
  const { platform = "web" } = customData != null ? customData : {};
826
825
  const { debug } = State().state;
@@ -835,7 +834,8 @@ ${key}: ${value}`;
835
834
  countryISOCode,
836
835
  customData,
837
836
  fbAccessToken,
838
- fbPixelId
837
+ fbPixelId,
838
+ testCode
839
839
  };
840
840
  try {
841
841
  const data = await fetch(url, {