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

# Introduction

> Learn how to get started with Adomatix platfrom

## Getting started

# Adomatix — Affiliate Marketing Platform for Ecom Brands

> The official documentation for Adomatix: an affiliate & referral SaaS built for e‑commerce brands. Track performance, pay for real results, and scale a partner ecosystem that converts.

***

## Table of contents

* Overview
* Quickstart
* Connect your store

  * Shopify
  * WooCommerce
  * Other platforms (custom)
* Platform concepts

  * Accounts & roles
  * Campaigns
  * Affiliates
  * Tracking (click\_id, sessions, cookies)
  * Attribution windows
* Getting started (Brands)
* Creating & managing campaigns

  * Product selection
  * Coupon vs. affiliate link
  * Commission types
  * Advanced rules
* Affiliate onboarding & management

  * Invite flows
  * Approvals & tiers
  * Creators dashboard
* Tracking & Pixel

  * JavaScript pixel (Shopify/Custom)
  * Server-side events (recommended)
  * Verifying installs
* Webhooks & API

  * Authentication
  * Key endpoints (create campaign, track conversion, payouts)
  * Example requests (PHP)
* Payouts & Billing

  * Payout schedules
  * Minimum thresholds
  * Refund handling
* Coupons & Discounts
* Reports & Analytics
* Security, Privacy & GDPR
* Troubleshooting
* FAQ
* Changelog
* Contact & Support

***

# Overview

Adomatix is an affiliate marketing platform built for e‑commerce brands who want to pay partners only for results. It handles partner discovery, link & coupon creation, conversion tracking, attribution, and payouts so you can focus on products and growth.

### Who it's for

* DTC brands selling on Shopify, WooCommerce or custom storefronts
* Growth teams wanting predictable, performance-based channels
* Agencies managing affiliate programs for multiple merchants

### Key features

* Easy store connection (Shopify & WooCommerce starter guides)
* Campaign builder: product selection, coupons, commission models
* Affiliate portal for signups, creatives, and payouts
* Pixel + server-side tracking for accurate attribution
* Real-time reporting and fraud protections
* Webhooks & API for integrating with your stack

***

# Quickstart (5 minutes)

1. Sign up at the Adomatix dashboard and create your brand.
2. Connect your store (Shopify / WooCommerce). See **Connect your store**.
3. Create a campaign: name it, choose products, set commission (percentage or fixed), and decide whether to use affiliate links or coupon codes.
4. Invite affiliates or publish the campaign to the marketplace.
5. Install the tracking pixel (or use server-side events) and verify events.
6. Start receiving conversions. Monitor reports and pay affiliates.

***

# Connect your store

## Shopify (recommended)

1. In Adomatix dashboard select **Connect store → Shopify**.
2. Enter your store domain (e.g. `yourstore.myshopify.com`) and follow the OAuth flow to install the Adomatix app.
3. When prompted allow scopes for orders, customers, products, and script\_tags.
4. After install, Adomatix will auto-create a script tag that sends `page_view` and `order` events to the platform.

> **Manual script tag** (if you prefer): add the following to your theme `<head>` (replace `YOUR_PUBLIC_KEY`):

```html theme={null}
<script>
  (function(){
    window.adomatix = window.adomatix || {};
    window.adomatix.key = 'YOUR_PUBLIC_KEY';
    var s = document.createElement('script');
    s.src = 'https://cdn.adomatix.com/pixel.js';
    s.async = true;
    document.head.appendChild(s);
  })();
</script>
```

Once installed, go to **Tracking → Verify** and place a test order to confirm `order.created` arrives.

## WooCommerce

Use the Adomatix plugin (available as a zip in the dashboard) or paste the pixel into `header.php` of your theme.

## Custom / Other

Use our server-side API to send conversion events directly from your backend (recommended for reliability). See **Webhooks & API**.

***

# Platform concepts

### Accounts & roles

* **Brand Admin** — full access to create campaigns, view conversions, manage payouts.
* **Campaign Manager** — create & edit campaigns but cannot change billing.
* **Affiliate** — partner who promotes products and earns commissions.

### Campaign

A campaign ties a set of products (or all products) to a commission model, creative assets, and tracking settings.

### Affiliate

Partners can be creators, influencers, publishers, or resellers. They receive either a unique referral link or a coupon code.

### Tracking

* `click_id` — a unique identifier appended to affiliate links to attribute conversions.
* Cookie-based sessions — when a visitor clicks a partner link, Adomatix stores a cookie with `click_id` and attribution metadata.
* Attribution window — default 30 days (configurable per campaign).

***

# Getting started (Brands)

## Checklist

* [ ] Create Brand and add billing
* [ ] Connect store (Shopify/WooCommerce)
* [ ] Install pixel or enable server-side events
* [ ] Create first campaign
* [ ] Invite at least one affiliate
* [ ] Run a test purchase and verify attribution

## Best practices

* Use server-side order forwarding from your backend when possible to avoid adblockers or script blockers.
* Use coupon + link combination for creators who also share discount codes.
* Set a reasonable attribution window (7–30 days) depending on purchase frequency.

***

# Creating & managing campaigns

## Create campaign (example flow)

1. Name & description
2. Select product(s) or collection
3. Choose commission type:

   * Percentage (e.g. 10% of item price)
   * Fixed amount per sale (e.g. ₹200 per sale)
   * Tiered/volume incentives
4. Attribution rules (first-click, last-click, order-level split)
5. Coupon code (optional) or auto-generated affiliate links
6. Assets: banners, UTM templates, sample copy

## Commission examples

```text theme={null}
- 10% commission on product price
- ₹150 fixed per completed order
- 5% for first 50 sales, 7% afterwards (tiered)
```

## Advanced rules

* Exclude discounted purchases
* Require minimum order value
* Exclude refunded orders from payouts

***

# Affiliate onboarding & management

## Invite flows

* Invite via email from dashboard
* Share public apply link to allow creators to request access
* Auto-approve or manual approval flows

## Profiles & tiers

* Affiliates have profiles showing metrics, creatives, and payout details
* You can set tiers: Bronze, Silver, Gold with different commissions

***

# Affiliate dashboard

Affiliates can:

* See personal referral links and coupon codes
* Get creatives (banners, captions)
* Track clicks, conversions, earnings
* Withdraw funds (if enabled by brand)

***

# Tracking & Pixel

## JavaScript pixel (basic)

```html theme={null}
<script>
  // Minimal example: call on page view
  if(window.adomatix){
    window.adomatix.track('page_view', { path: location.pathname });
  }

  // On checkout success page, send order event
  window.adomatix.track('order', {
    order_id: '12345',
    value: 2499.00,
    currency: 'INR',
    items: [{id: '8345687064664', quantity: 1, price: 2499}]
  });
</script>
```

### Server-side events (recommended)

Send a POST to the Adomatix event endpoint from your backend when an order is created or updated. This avoids adblockers and is more reliable.

**Endpoint:** `POST https://api.adomatix.com/v1/events`

**Body (JSON)**

```json theme={null}
{
  "type":"order.created",
  "brand_id":"BRAND_ABC",
  "order":{
    "id":"1001",
    "total":2499.00,
    "currency":"INR",
    "items":[{"id":"8345687064664","quantity":1,"price":2499}]
  },
  "click_id":"CLICK_12345"
}
```

**Headers:** `Authorization: Bearer <API_KEY>`

***

# Webhooks & API

## Authentication

* Use API keys issued in the dashboard: `Bearer <secret_key>`.
* For webhooks, validate signature using the `X-Adomatix-Signature` header.

## Important endpoints

* `GET /v1/brands/:brand_id/campaigns` — list campaigns
* `POST /v1/events` — track `order.created`, `order.refund`, `page_view`, etc.
* `GET /v1/affiliates/:id` — affiliate details
* `POST /v1/payouts` — create payout batch

## PHP example: sending an event

```php theme={null}
<?php
$payload = [
  'type' => 'order.created',
  'brand_id' => 'BRAND_ABC',
  'order' => [
    'id' => '1001',
    'total' => 2499.00,
    'currency' => 'INR',
    'items' => [ ['id'=>'8345687064664','quantity'=>1,'price'=>2499] ]
  ],
  'click_id' => 'CLICK_12345'
];

$ch = curl_init('https://api.adomatix.com/v1/events');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Content-Type: application/json',
  'Authorization: Bearer YOUR_SECRET_KEY'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$res = curl_exec($ch);
curl_close($ch);
echo $res;
```

***

# Payouts & Billing

* Payout methods: Bank transfer (ACH/NEFT), PayPal, or manual CSV.
* Payout schedule: Weekly/Monthly (configurable) with minimum threshold.
* Refunds: refunded orders automatically create reversal events; commissions are deducted from future payouts.

***

# Coupons & Discounts

* Auto-generate coupon codes per affiliate, or allow affiliates to set custom codes.
* Coupon attribution uses code + link fallback.
* Track coupon redemptions in `coupon.redeemed` events.

***

# Reports & Analytics

* Overview: clicks, conversions, CR, revenue, payout liability
* Campaign report: performance by product and affiliate
* Affiliate leaderboard and cohort analysis
* Export CSVs and connect to BI tools via webhooks

***

# Security, Privacy & GDPR

* We store minimal PII required for payouts (name, email, payout details).
* Provide data export & deletion endpoints for GDPR/CCPA requests.
* Use signed webhooks and TLS for all traffic.

***

# Troubleshooting

### Common issues

**No conversions showing after install**

* Verify pixel or server events are firing (see Tracking → Verify).
* Check that `click_id` is present on the order object.
* Ensure attribution window and cookie settings are correct.

**Refunded orders still showing as paid**

* Confirm your store forwards `order.refunded` events to Adomatix.

***

# FAQ

**Q: Can I use both coupon codes and affiliate links?**
A: Yes — we recommend using both to maximize attribution and creator flexibility.

**Q: Do you support multi‑currency?**
A: Yes. Orders should include `currency` on `order` events.

**Q: How do I handle VAT or taxes?**
A: Commissions are calculated on the `order.total` you send — exclude taxes if you don't want to pay them on commissions.

***

# Changelog

* `2025-09-01` — Added server-side events guide and tiered commissions
* `2025-07-21` — Public beta release

***

# Contact & Support

* Dashboard → Support to create a ticket
* Email: [support@adomatix.com](mailto:support@adomatix.com)
* Developer Slack (invite from dashboard)

***

*Need custom examples, more detailed API docs, or a branded README for your developer team? Reply here and I’ll expand sections or add SDK samples.*
