title: test if facebook pixel id loaded
body: <p>if one calls the facebook function:</p>
  
  <pre><code>fbq('init', &lt;pixel_id&gt;)
  </code></pre>
  
  <p>more than once for the same pixel id, it generates the error:</p>
  
  <p>Facebook Pixel Error: Duplicate Pixel ID</p>
  
  <p>the solution on <a href="https://stackoverflow.com/a/38479447/3226837">this</a> answer is to use first</p>
  
  <pre><code>if(typeof fbq === 'undefined') {
  fbq('init', &lt;pixel_id&gt;)
  }
  </code></pre>
  
  <p>however i am using multiple pixel_ids on the same page. so this will not load the second pixel id if the first is already loaded.</p>
  
  <p>is there a way to check if a particular pixelid is loaded and not just if fbq is loaded? something like:</p>
  
  <pre><code>if(typeof fbq === 'undefined') {
      fbq('init', &lt;pixel_id&gt;);
  }
  else {
      if (!fbq.pixel_id)
              fbq('init', &lt;pixel_id&gt;);
  }
  </code></pre>