January 31, 2018

How to Install the Facebook Pixel (PageView Event, Purchase Events ) on Squarespace Sites

Facebook PageView event code for SquareSpace Site

In this Article we will see how we can integrate the Facebook PageView Pixel which will track each and every visit from the Visitors of Facebook Ad.We will also discuss how to track Purchase event of your Facebook Pixel.

  • Log into your Squarespace account and click on Settings.
  • At the bottom of the Website section on the left-hand menu, click on Advanced.
      • how to install the facebook pixel squarespace settings Click on Code Injection.how to place pixel squarespace 2
      • Paste the Pixel in the box under Header.
      • <!-- Facebook Pixel Code -->
        <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', 'YourPixelId');//Please Replace with yourPixel Id Like 336288036710618
        fbq('track', 'PageView');
        </script>
        <!-- End Facebook Pixel Code -->

      how to install the facebook pixel squarespace code injection

      And you’re done!

This will Track Page Visit so while pasting code make sure it has fbq(‘track’,’PageView’);

Now we will start how to Integrate the Facebook Purchase event to start tracking purchases using your Facebook pixel, you’ll need to copy the purchase event code below and paste it on your website.

Facebook Purchase event code for SquareSpace Site

  1. <script type="text/javascript">
  2. window.onload = function() {
  3. window._fbq.push('track', 'Purchase', {
  4. content_id: '{orderId}',
  5. value: '{orderGrandTotal}',
  6. currency: 'USD'
  7. });
  8. };
  9. </script>

Go to Squarespace Site and click Settings. Then click Advanced and Code Injection.

Paste above  purchase code under Order Confirmation Page.

Click Save. You’ve now completed setting up Facebook purchase event code on your website and can measure purchases resulting from your Facebook advertising.

 

Leave a Reply

Your email address will not be published. Required fields are marked *