title: Facebook Pixel - Submit Button
body: <p>We just started our first Facebook campaign and are trying to track leads and conversions.  We created a pixel in FB and want to track when a user clicks <code>submit</code> on a contact form.  The issue is that our <code>submit</code> button doesn't take the user to a separate "confirmation" page, instead we just have a success message pop up on the contact form. The issue we're having is - that it's tracking both conversions and leads when you visit the website.  So we if someone goes to the website we see both a lead and conversion.  A lead should only appear when a user clicks "submit" on the form. </p>
  
  <p>Below is the code we currently have:</p>
  
  <pre><code>// INITIALIZATION CODE
  &lt;script&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];
          s.parentNode.insertBefore(t, s)
      }(window,
          document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');
  
      fbq('init', '//OurIDGoesHere');
      fbq('track', "PageView");
  
      fbq('track', "Lead");
  &lt;/script&gt;
  &lt;noscript&gt;&lt;img height="1" width="1" style="display:none"
      src="https://www.facebook.com/tr?id=(OURIDCODE)&amp;ev=PageView&amp;noscript=1"
      /&gt;&lt;/noscript&gt; // BUTTON CODE
  &lt;div class="button-wrap"&gt;
      &lt;button id="talkButton" data-dialog="somedialog" class="triggercontact
      &lt;i class=" fa fa-envelope "&gt;&lt;/i&gt;Talk to Us!&lt;/button&gt;
      &lt;/div&gt;
  
      // CLICK EVENT CODE
      &lt;script type="text/javascript "&gt;
          $('#talkButton').click(function() {
            fbq('track', 'Lead', {
                content_category: 'Page'
            });
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>Thanks in advance! </p>