---
name: bijection-affiliate-tracking
description: "Evaluate and integrate the Affiliate Tracking component with Bijection."
---

# Affiliate Tracking

A Bijection component for affiliate tracking, attribution, commissions, payouts, and analytics.

- Package: @bijectionhq/affiliate-tracking
- Category: Integrations
- Status: Preview
- License: MIT
- Bijection source (repository access required): https://github.com/bijectionhq/affiliate-tracking/tree/0dee74dc15dbbd40a2a55579d9b4661ae6941ffe
- Upstream: https://github.com/ezyyeah/affiliate-tracking/tree/d55c638da75e522fe4e34fbeb546d56cb5051f71
- Documentation: https://docs.bijection.com/components/using
- Directory: https://bijection.com/components/affiliate-tracking

## Get the source

Bijection repository access is required. Request access at https://bijection.com/contact.

```sh
git clone https://github.com/bijectionhq/affiliate-tracking.git
cd affiliate-tracking
git checkout 0dee74dc15dbbd40a2a55579d9b4661ae6941ffe
```

## Before using this component

Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This is a source candidate for evaluation. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute.

## Integration workflow

1. Read the source README and package manifest at the recorded revision.
2. Confirm the required SDK, dependency availability, and runtime compatibility.
3. Follow the component's documented setup and configuration. Never invent an npm install command from a catalog package name.
4. Keep credentials in the project's existing secret store.
5. Follow the project's execution rules for verification and report what was actually checked.

## Original upstream skill

The following guidance describes @ezyyeah/affiliate-tracking. Its installation commands and APIs refer to the upstream package. Evaluate compatibility with the Bijection source separately.


# Affiliate Tracking

## Instructions

Use Affiliate Tracking to complete affiliate tracking system for convex apps with attribution, commissions, payouts, and analytics in an isolated component. This Convex component integrates directly with your backend.

### Installation

```bash
npm install @ezyyeah/affiliate-tracking
```

### Capabilities

- Track affiliate clicks and conversions with configurable attribution windows and deduplication rules
- Calculate commissions automatically with percentage or fixed-rate models and operational approval workflows
- Generate payout batches from approved commissions with audit trails and status management
- Access real-time analytics through daily sharded counters for programs, affiliates, campaigns, and links

## Examples

### how to add affiliate tracking to Convex app

The @ezyyeah/affiliate-tracking component provides complete affiliate functionality as an isolated Convex component. Mount it in your app config, create programs with commission rates, enroll affiliates with referral links, and track clicks through HTTP actions that redirect visitors while recording attribution data.

### Convex affiliate commission tracking

This component automatically calculates commissions when conversions are recorded, supporting both percentage and fixed-rate models. Conversions move through pending, approved, rejected, and paid states with full audit trails and can be batch processed into payouts for approved commissions.

### affiliate link click tracking Convex

Track affiliate clicks from Convex HTTP actions using the trackClick mutation, which records visitor data and returns the destination URL for redirects. The component handles deduplication based on configurable rules and attribution windows defined at the program level.

### affiliate analytics dashboard Convex

Access affiliate performance data through getSummary for aggregate numbers and getDailyBreakdown for time-series analytics. The component maintains daily sharded counters for clicks and conversions across program, affiliate, campaign, and link dimensions.

## When NOT to use

- When a simpler built-in solution exists for your specific use case
- If you are not using Convex as your backend
- When the functionality provided by Affiliate Tracking is not needed

## Troubleshooting

**How does the affiliate attribution model work?**

The @ezyyeah/affiliate-tracking component uses configurable attribution windows and deduplication rules per program. You can set how long clicks remain eligible for conversion credit, deduplicate clicks by visitor or link, and limit conversions by customer or visitor within rolling time windows.

**Can I customize commission rates for different affiliates?**

Yes, the component supports both program-level default commissions and campaign-specific overrides. Programs define default commission types (percentage or fixed) and values, while campaigns can override these settings for specific affiliate promotions or products.

**How does the component handle authentication and authorization?**

The @ezyyeah/affiliate-tracking component intentionally does not handle auth - your host app manages authentication and authorization. You check permissions in your Convex functions and pass actorId strings to component functions for audit trails.

**What analytics data does the component provide?**

The component tracks clicks, conversions, commissions, and revenue through daily sharded counters. You can access aggregate summaries and daily breakdowns scoped by program, affiliate, campaign, or link using the getSummary and getDailyBreakdown functions.

**How do I handle duplicate conversions and clicks?**

The @ezyyeah/affiliate-tracking component provides multiple deduplication strategies including visitor-based, link-based, and custom deduplication keys. Conversions use idempotency keys to prevent double-counting, and you can configure rolling windows for both click and conversion deduplication.

## Resources

- [npm package](https://www.npmjs.com/package/%40ezyyeah%2Faffiliate-tracking)
- [GitHub repository](https://github.com/ezyyeah/affiliate-tracking)
- [Live demo](https://github.com/ezyyeah/affiliate-tracking/tree/main/examples)
- [Convex Components Directory](https://www.convex.dev/components/ezyyeah/affiliate-tracking)
- [Convex documentation](https://docs.convex.dev)