Collapse Menu
Classic Docs
Order Page Config, Design and Page Flow
Advanced Features
Subscriptions and Saasy
Contact Support

Setting Up Facebook Pixel Tracking

This article provides instructions to set up Facebook Pixel Tracking on your FastSpring Store.

 

This article provides instructions to set up Facebook Pixel Tracking on your FastSpring Store.

Note:  Before beginning this process, ensure that you have the Facebook Pixel Tracking code provided to you by Facebook.
  1. Log on to Springboard and select your Store, if necessary.  Then, click External Tracking.

    External_Tracking_650.png
     
  2. Click Adding Tracking Method.

    Add_Tracking_Method_650.png
     
  3. Leave the default setting, Custom Tracking Method, selected, and click Next.

    Click_Next_650.png
     
  4. In the Name field, enter Facebook Pixel.

    Name_650.png
     
  5. Optionally, if you want the code applied to all Store pages (rather than just the completion page), select the check box labeled Apply to All Pages.
  6. Click into the <head> section and then copy and paste in the code you received from Facebook.

    head_section_650.png
     
  7. Still in the <head> section, modify the code as follows:
    1. Remove the comments <!-- Facebook Pixel Code --> and <!-- End Facebook Pixel Code -->.
    2. Remove everything from <noscript> to </noscript>, including those tags.
    3. Optionally, create a new line after fbq('track', "PageView");.  If you want to track purchases, add the following code on the new line:

      <if test="#{complete}">
          fbq('track', 'Purchase', {'value': '#{order.total}', 'currency': '#{order.currency}'});
      </if>
    4. Here is an example of the revised function, including the optional purchase tracking code.
       
      Important:Please note that this is only an example; if you do not start with the code provided by Facebook and follow the instructions above, Pixel Tracking will not work.

      <script>
      !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', '1262415707141961'); 
      fbq('track', "PageView");
      <if test="#{complete}">
      fbq('track', 'Purchase', {'value': '#{order.total}', 'currency': '#{order.currency}'});
      </if>
      </script>

  8. Scroll down if necessary, and click Next.

    Click_Next_2_650.png
     
  9. In the Actions section in the top right-hand portion of the next page, click the switch to toggle between Test and Active status. Then, click Save.

    Active_650.png
Note: For users of Google Chrome, Facebook offers a convenient tool called Facebook Pixel Helper, which may be helpful in testing and validating your implementation. You can download the Chrome plugin for free at https://chrome.google.com/webstore/detail/facebook-pixel-helper/fdgfkebogiimcoedlicjlajpkdmockpc?utm_source=chrome-app-launcher-info-dialog.