# Custom/Self-Hosted – How to Track Foxy Purchases

### **Why track Foxy 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 can log into the Foxy admin panel and manage integrations.

***

### Step-by-Step Setup

#### 1 · Copy your Humblytics webhook details

In your Humblytics dashboard:

1. Navigate to **Site Settings → Revenue**.
2. Copy the **Foxy Webhook URL**.
3. Copy the **Encryption Key**—you'll paste both values into Foxy.

> Keep the Humblytics tab open. You'll need to confirm the integration after you finish in Foxy.

***

#### 2 · Configure the Foxy JSON webhook

In the Foxy admin panel:

1. Log into your Foxy account.
2. Go to **Integrations → Webhooks**.
3. Enable **JSON Webhook**.
4. Add a new webhook, pasting the Humblytics **Webhook URL** you copied earlier.
5. Paste the matching **Encryption Key** from Humblytics.
6. Select **`transaction`** events.
7. In **API filter**, include `zoom=items,customer,custom_fields,subscription`.
8. Save your webhook configuration.

***

#### 3 · Verify tracking is working

1. Complete a test purchase on your live site.
2. Open **Revenue → Foxy** (or **Revenue → Integrations**) in Humblytics.
3. Confirm that the transaction appears with line items and customer details within about 30 seconds.
4. Once the webhook syncs, Humblytics automatically attributes the revenue to the visitor journey captured by the global script.

<figure><img src="https://1281224403-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqZMBn2D7F1lV2hgGTS2X%2Fuploads%2Fgit-blob-03cda6f7f20de3a0b845c778d90a11e8425c6eb1%2Frevenue-attribution-card.png?alt=media" alt=""><figcaption></figcaption></figure>

***

### 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 **Revenue Event** as your goal type.

#### 2 · Configure the conversion goal

1. Select the **Foxy transaction** revenue event created by the webhook.
2. Set **No Overlap** for more accurate results with purchase events.
3. Launch your split test.

<figure><img src="https://1281224403-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqZMBn2D7F1lV2hgGTS2X%2Fuploads%2Fgit-blob-03fecd05b7f04beb97bc4db8b0cd83737d35eae1%2FSplit-test-revenue%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

***

#### Optional Enhancements

* **Funnels:** Create a funnel from landing page → product page → checkout → purchase using the Foxy transaction event for completion.
* **Campaign Attribution:** Use UTM parameters on your marketing campaigns to see which sources drive the most sales.
* **Advanced Events:** Track additional Foxy events like cart abandonment or upsell interactions.

***

For advanced use cases—custom Foxy events, multi-step funnels, or complex attribution models—email **<support@humblytics.com>** and we'll guide you through.
