title: Trying to include https://connect.facebook.net/en_US/fbevents.js locally but I get a Facebook Pixel Error
body: <p>In firefox I get </p>
  
  <pre><code>Facebook Pixel Error: TypeError: cd is undefined
  </code></pre>
  
  <p>Chrome</p>
  
  <pre><code>Facebook Pixel Error: TypeError: Cannot read property 'replace' of undefined
  </code></pre>
  
  <p>The html</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  !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='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0]}(window,document,'script','//connect.facebook.net/en_US/fbevents.js');
  fbq("init","1111111111111111");fbq("track","PageView");
  &lt;/script&gt;
  &lt;script type="text/javascript" src="/js/fbevents.js" async="async"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Contents of /js/fbevents.js is the same as <a href="https://connect.facebook.net/en_US/fbevents.js" rel="nofollow noreferrer">https://connect.facebook.net/en_US/fbevents.js</a>. Any idea why these error are showing up?</p>
  
  <p>The inline script has been modified and <code>s.parentNode.insertBefore(t,s)</code> has been removed from this example <a href="https://developers.facebook.com/docs/ads-for-websites/pixel-events/v2.10" rel="nofollow noreferrer">https://developers.facebook.com/docs/ads-for-websites/pixel-events/v2.10</a></p>
  
  <p>Looks like its trying to load and failing...
  <a href="https://connect.facebook.net/signals/config/1111111111111111?v=2.7.19" rel="nofollow noreferrer">https://connect.facebook.net/signals/config/1111111111111111?v=2.7.19</a> which is triggered by this JS at the bottom of fbevents.js</p>
  
  <pre><code>fbq.registerPlugin("global_config", {
  __fbEventsPlugin: 1,
  plugin: function(fbq, instance) {
      fbq.loadPlugin("opttracking");
      fbq.loadPlugin("performance");
      instance.configLoaded("global_config");
  }
  });
  </code></pre>
  
  <p>Note 1111111111111111 is not the real PIXEL_ID. The real PIXEL_ID returns legit JS.</p>