How Do I Add Custom Tracking Code?

SPP comes with a Google Analytics integration which gives you a detailed overview of your sales funnel.

To integrate other tracking scripts you can use the template editor in Settings > Templates and add your site-wide tracking code to your public/custom_scripts.html template. This will be loaded across all pages of your SPP Client Panel and order forms.

Facebook tracking code example

To add a separate conversion tracking pixel you can edit the clients/receipt.html template (this is the Thank You page in SPP). When editing this template put your code in the content block–that’s between the {% block content %} and {% endblock %} tags.

If you want to track order totals, use the {{ invoice.subtotal }} variable in your conversion script, which gives you the total invoice amount minus tax.

The example code below is for Facebook’s pixel, which tracks the invoice subtotal and payment currency.

<script>
    fbq('track', 'Purchase', {
        currency: "{{ invoice.currency }}",
        value: "{{ invoice.subtotal }}"
    });
</script>
Facbook conversion pixel example

Note on testing conversion 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 the conversion code.

Our built-in Google Analytics module sends conversion data using server-side scripts and isn’t affected by ad blocking plugins.

Updated over a week ago

Thanks for your feedback 🙏

Was this helpful?