Conversion Pixels

SPP comes with a dedicated Google Analytics integration which provides a reliable way to track your sales funnel and e-commerce metrics.

In this article you’ll learn how to set up other trackers including Facebook and Google Ads.

Let’s start with a quick overview first.

How Tracking Works

Most applications have one or two different tracking codes – a site-wide code that goes in the header of all your pages and a conversion code that should be loaded only when a conversion event happens.

Site-wide tracking code

To add any site-wide tracking scripts to your Client Portal’s header you can use the template editor in Settings → Templates.

From the left side open up your public/custom_scripts.twig template. This is where you can paste the code that’s provided to you by the application.

Conversion tracking code

To track purchases you need to have a tracking code on the page that’s loaded after a successful payment. In SPP that's the receipt page at https://username.spp.io/receipt/ABCD and the template for your conversion scripts is public/custom_scripts_conversion.twig.

Some tracking scripts can be customized with variables from the purchase. Here are some of the variables you can use in your conversion scripts:

  • {{ invoice.subtotal }} – invoice total without tax or credits

  • {{ invoice.currency }} – three-letter currency code

  • {{ invoice.transaction_id }} – invoice's transaction ID, could be useful to prevent tracking the same transaction twice

Facebook / Meta Tracking

Step 1: Paste the main tracking code that Meta gives you into your public/custom_scripts.twig template:

SPP facebook pixel code tracking custom_scripts template

Step 2: To track conversion events open the public/custom_scripts_conversion.twig template. We've provided a sample script for you to use, feel free to modify it for your needs.

Step 1: Add the main site tag code to your public/custom_scripts.twig template as seen here:

SPP google ads tracking script custom_scripts template

Step 2: Copy and paste this code to your clients/custom_scripts_conversion.twig template.

Step 3. Update the code with your conversion ID.

Testing Tracking Pixels

Any ad blocker plugins you have installed in your browser may prevent the conversion pixel from firing. Be sure to turn them off while you’re testing your tracking codes.

You can use plugins like FB Pixel Helper and Google Tag Assistant to check your tags. Turn off live mode for your SPP and try placing a test order.