Adding a Facebook pixel to your Pixpa store

The Facebook pixel is an analytics tool that helps you measure the effectiveness of your Facebook advertising. Add the Facebook pixel to your Pixpa store to track ad conversions, improve audience targeting and maximize your return on advertising spend.

Before you add a Facebook pixel to your store, we recommend you to learn more about the Facebook pixel at the Facebook Help Center.


To set up Facebook pixel tracking, follow the steps below:

 

Step 1: Create a Facebook pixel in your Facebook Ad account

You need to set up your pixel first in Facebook Ad Manager.
See: Create and install a Facebook pixel.

Step 2: Add the pixel code in the Pixpa store

  • Install the pixel code to your store and website so that it loads on each page.
  • Facebook pixel code can be added above or below existing tracking tags (such as Google Analytics) in your site header.
  • Copy the entire pixel code and paste it into the External Script <head> Section.
    Also Check: Add an External Script.


  • Here’s an example of a default pixel code, where “FACEBOOK PIXEL ID” stands for the pixel ID that’s unique to your Facebook Ads account:
<!-- 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', 'FACEBOOK PIXEL ID');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=FACEBOOK PIXEL ID&ev=PageView
&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

Facebook Pixel standard events

  • Standard events within the Facebook pixel code enable you to track specific events, optimize conversions and build an audience.
  • Standard event codes are case-sensitive, so make sure that you copy the code snippet exactly as it appears.
    For example, the standard event code for tracking page views is fbq(‘track’, ‘PageView’); as shown in the table below.
    See: Specifications for Facebook pixel standard events.


Set the dynamic value and currency of your pixel events

  • The default value and currency in the standard event (purchase) code is USD 0.00, but you can edit this to reflect the true value of your conversions.
    If you have multiple values that you want to track (e.g. you’re selling multiple items with different prices), you can make the value dynamic.
  •  Your event script looks similar to the following example:
<script>
fbq('track', 'Purchase', { 
value: 1.0,
currency: 'USD'
});
</script>

  • The default currency is USD. If you don’t sell in US dollars, then replace ‘USD’ in the event snippet with a dynamic variable of Pixpa store currency, i.e. ‘currency.’
  • The default value is 1.0. To capture the correct order amount replace it with a dynamic variable of Pixpa order amount, i.e. ‘ revenue.’
  • After you replace the variables, your event script looks similar to the following example:
    <script>
    fbq('track', 'Purchase', { 
    value: revenue,
    currency: 'currency'
    });
    </script>

    You need to add this dynamic event snippet to the order success page.
    See: Add an External Script.

     

Can't find what you're looking for?

Get in touch with a Pixpa Expert.