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 code to both public/layout.html and clients/layout.html templates. Paste your code either before the closing </body> tag or the closing </head> tag.

To add a separate conversion tracking pixel you can edit the clients/receipt.html template. 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 ?: config.payment_currency }}",
        value: "{{ invoice.subtotal }}"
    });
</script>
Updated over a month ago

Thanks for your feedback 🙏

Was this helpful?