> ## Documentation Index
> Fetch the complete documentation index at: https://support.tapfiliate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Integrate Magento with Tapfiliate

> This guide walks you through connecting your Magento store with Tapfiliate.

November 9, 2026

In this article, we will cover:

* [Why Magento is a powerful integration for Tapfiliate](#h_9e0f925cb9)
* [What you need before starting the integration](#h_d896c6fe25)
* [Step-by-step setup](#h_86be865867)
* [Advanced optional features](#h_4b182ce74c)
* [Testing and verification](#h_9f0cf08f1a)

## Magento Integration Overview

Tapfiliate provides a flexible integration method for Magento, enabling accurate tracking of affiliate clicks and conversions, including coupon-based conversions and lifetime commissions. Magento 1 integrates with Tapfiliate through template edits, while Magento 2 relies on a third-party extension to enable tracking.\

**Pros:**

* Conversion tracking
* Commission based on order amount
* Affiliate coupon-code conversions
* Lifetime/recurring commissions

**Cons:**

* Developer required (code changes needed)
* Only supports Magento 1 out of the box
* Magento 2 integration depends on a third-party provider

## Prerequisites for integrating Magento

To successfully integrate, ensure you have the following:

1. A Tapfiliate account with your Account ID
2. Admin access to your Magento backend
3. Ability to edit theme templates (footer + success page)

## Steps to complete tracking setup

**Step 1: Set up click tracking**\

To install Tapfiliate tracking on your Magento store, add the main tracking code to your footer.\

**In Magento Admin (Magento 1):**\

Go to:\

**Configuration → General → Design → Footer**

![](https://mintcdn.com/tapfiliate-help/1iW9-M7MOhKRwS9v/images/1693956/01-738f3966-b8c9-46b8-aed6-5a1ac576a4a8.png?fit=max\&auto=format\&n=1iW9-M7MOhKRwS9v\&q=85\&s=4c4885b0b21a4ace5230fb13b901e65d)

Paste the following code into **Miscellaneous HTML**:

```html theme={null}
<script src="https://script.tapfiliate.com/tapfiliate.js" async></script>
<script>
(function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
(t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');
tap('create', 'YOUR-ACCOUNT-ID', { integration: "magento" });
tap('detect');
</script>
```

Replace **YOUR-ACCOUNT-ID** with your actual Tapfiliate account ID.\

This code enables global click tracking on all store pages.\

**Step 2: Set up conversion tracking (Magento 1)**\

To track purchases, add a conversion script to your order success page.\

**Edit the success page template:**\

Open the file:\

app/design/frontend/XXXX/XXXX/template/checkout/success.phtml\

Add the following code at the end:

```php theme={null}
<?php
$order = Mage::getModel('sales/order')
    ->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
$amount = number_format(
    $order->getGrandTotal()
    - $order->getShippingAmount()
    - $order->getShippingTaxAmount(),
    2, '.', ''
);
$options = array('customer_id' => $order->getCustomerEmail());
if ($order->getCouponCode()) {
    $options['coupons'] = $order->getCouponCode();
}
?>
<script src="https://script.tapfiliate.com/tapfiliate.js" async></script>
<script>
(function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
(t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');
tap('create', 'YOUR-ACCOUNT-ID', { integration: "magento" });
tap('conversion', '<?php echo $this->getOrderId() ?>', <?php echo $amount ?>, <?php echo json_encode($options) ?>);
</script>
```

This tracks conversions with the order ID and the calculated order subtotal (excluding shipping & shipping tax), together with the customer’s email as the customer ID (for lifetime commissions) and the order’s coupon code, if one was used.\

**Magento 2 Integration (via third-party)**\

Magento 2 does not include native Tapfiliate integration. Instead, install the **free third-party extension** from Meetanshi:\

Download:\

**[https://meetanshi.com/magento-2-tapfiliate-integration.html](https://meetanshi.com/magento-2-tapfiliate-integration.html)**\

**Note:** Since this integration is created and maintained by a third-party developer, Tapfiliate support cannot assist with Magento 2-specific extension issues.

![](https://mintcdn.com/tapfiliate-help/1iW9-M7MOhKRwS9v/images/1693956/02-b1663f72-742b-41f7-b71f-e7f186b923ef.png?fit=max\&auto=format\&n=1iW9-M7MOhKRwS9v\&q=85\&s=104604be50acc96318ab1191747fd3ac)

## Advanced or Optional Features

### Affiliate coupon-code tracking

If you created coupon codes for affiliates in Tapfiliate:

* Use the Tapfiliate coupon tracking feature
* The Magento 1 conversion code above sends the order’s coupon code with the conversion, so affiliate coupons attribute the sale

### Order amount–based commissions

Tapfiliate will calculate commission based on the amount passed in the conversion script.

### Lifetime / recurring commissions

Tapfiliate supports recurring/lifetime commissions for all customers who originate from an affiliate.

### Refund & dispute handling

Refunds and disputes are not synced from Magento automatically. When an order is refunded, disapprove the commission of that conversion in Tapfiliate (the conversion’s external ID is your Magento order number).

## How to Test and Verify Integration

Follow these steps to test your Magento tracking:

1. **Create a test affiliate** in Tapfiliate
2. Open the test affiliate’s **referral link** in an incognito window
3. Verify that the click appears in:\
   &#x20;**Tapfiliate → Reporting → Affiliates → Clicks**
4. Complete a test purchase to trigger your success page conversion script
5. Check **Tapfiliate → Conversions** to confirm the conversion appears
6. Ensure the:
   * Order ID matches
   * Amount matches

If conversions do not appear, follow Tapfiliate’s troubleshooting guide or confirm your template path and IDs.\

**Need More Help?**\

If you have questions or need assistance, feel free to contact us at **[support@tapfiliate.com](mailto:support@tapfiliate.com)**. We're happy to help!


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.