Custom/Self-Hosted – How to Track Foxycart Purchases

Why track Foxycart purchases?

  • Track the end-to-end purchase process from your site to checkout and successful purchase

  • Attribute sales to campaigns, traffic sources, A/B tests

  • Run split tests with purchase events as conversion goals

  • Preserve a cookie-free, privacy-compliant analytics stack—no banners required


Prerequisites

  • Your main website already loads the global hmbl.min.js script (36 kb, async).

  • You have access to your Foxycart account with permission to modify custom templates.

  • Your Foxycart domain is whitelisted in your Humblytics dashboard.


Step-by-Step Setup

1 · Whitelist your Foxycart domain

In your Humblytics dashboard:

  1. Navigate to Settings → Domains.

  2. Add your Foxycart checkout domain to the whitelist.

  3. Save the changes.


2 · Add Humblytics tracking to Foxycart

In your Foxycart admin panel:

  1. Go to Settings → Templates → Custom Footer.

  2. Add the Humblytics tracking code:

<!-- Start Humblytics Tracking Code -->
<script
  async
  src="https://app.humblytics.com/hmbl.min.js?id=YOUR_HUMBLYTICS_ID"
></script>
<!-- End Humblytics Tracking Code -->

{% if context == 'checkout' %}
<script>
  window.Humblytics.trackPageView("/foxycart-checkout", {
    domain: "your-domain.com",
  });
</script>
{% endif %} {% if context == 'receipt' and first_receipt_display %}
<script>
  window.Humblytics.trackPageView("/foxycart-receipt", {
    domain: "your-domain.com",
  });
</script>
{% endif %}
  1. Replace YOUR_HUMBLYTICS_ID with your actual Humblytics ID from the dashboard.

  2. Replace your-domain.com with your main website domain.

  3. Save the template changes.


3 · Verify tracking is working

  1. Complete a test purchase on your live site.

  2. Open Dashboard → Pages in Humblytics.

  3. Look for /foxycart-checkout and /foxycart-receipt page views. Data appears within ~30 seconds.


Key Benefits

Benefit
Detail

Cookie-free

No consent banners or CMP required

End-to-end tracking

Complete customer journey visibility

Works on every plan

All Humblytics tiers support custom events

Split test ready

Use purchase events as conversion goals


Setting Up Split Tests with Purchase Goals

1 · Create a split test on your main website

  1. In Humblytics, navigate to Experiments → Create New Test.

  2. Set up your A/B test variants on your main website.

  3. Choose Destination Page as your goal type.

2 · Configure the conversion goal

  1. Enter /foxycart-receipt as the destination page.

  2. Set No Overlap for more accurate results with purchase events.

  3. Launch your split test.

Tip: For low-traffic sites, consider using /foxycart-checkout as the goal to gather data faster, though this will measure checkout initiation rather than completed purchases.


Optional Enhancements

  • Funnels: Create a funnel from your landing page → product page → /foxycart-checkout/foxycart-receipt to identify drop-off points.

  • Campaign Attribution: Use UTM parameters on your marketing campaigns to see which sources drive the most sales.

  • Advanced Events: Track additional Foxycart events like cart abandonment or upsell interactions.


For advanced use cases—custom Foxycart events, multi-step funnels, or complex attribution models—email [email protected] and we'll guide you through.

Last updated

Was this helpful?