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

# ClickBank

> Set up ClickBank as a merchant, including pitch flow and domain assignment

This guide covers setting up ClickBank as a merchant to sell your products through the ClickBank marketplace, including pitch flow configuration and merchant setup.

<Note>This is for merchants selling through ClickBank. If you're an affiliate promoting ClickBank products, see the [ClickBank Affiliate Integration](/integrations/clickbank) instead.</Note>

## Prerequisites

* Active ClickBank account with vendor access (ClickBank term)
* Approved products in ClickBank marketplace
* Admin access to your ClickBank account
* Understanding of ClickBank pitch flow system

## Step 1: Create ClickBank Merchant

### Add Merchant Configuration

1. Go to **Settings** → **Merchants** → **Add Merchant**
2. Select **Gateway**: ClickBank
3. Enter your **Account ID** (your ClickBank account nickname)
4. Create an **Encryption Key** (see below for details)
5. Save the merchant configuration

### Understanding Encryption Keys

The encryption key is **not** an API key - it's a security key you create:

* **Purpose**: Encrypts data sent between ClickBank and ElasticFunnels
* **Security**: Prevents man-in-the-middle attacks on postback data
* **User-defined**: You create this key (can be any string)
* **Synchronization**: Must be identical in both ClickBank and ElasticFunnels

**Example**: `MySecretKey2024!` (use your own unique key)

<Note>
  For postback configuration, use the **Setup** modal available from the **Merchants** list. It provides the exact URL and parameters to copy into ClickBank and is kept up to date.
</Note>

## Step 2: Configure Domain-Merchant Assignment

### Assign Merchant to Domain

1. Go to **Settings** → **Domains** → **Edit Domain**
2. Select your ClickBank merchant from the dropdown
3. Save the domain configuration

This ensures all funnels on this domain use ClickBank for payments.

## Step 3: Set Up ClickBank Pitch Flow

### Create Pitch Flow in ClickBank

1. Log into your ClickBank account
2. Go to **Pitch Flows** section
3. Click **Create New Pitch Flow**
4. Add all product variants you plan to split test:
   * Different price points (3 bottles, 6 bottles, 12 bottles)
   * Different bonus packages
   * Different upsell combinations
5. Save and note the **Pitch Flow ID** (CBFID)

### Use Funnel Node URLs for Upsell/Decline Targets

Instead of pointing upsells to specific page slugs (e.g., `upsell-1`), use the URL from your funnel nodes:

1. Open your funnel in ElasticFunnels
2. For each step in your flow, click the **Purchase** or **Decline** node that leads to the next page
3. Click **Copy Node URL**
4. Paste this URL into the corresponding **Upsell** or **Decline** target in your ClickBank Pitch Flow

This decouples ClickBank from individual page URLs. You can later split test or swap the page shown at that node without changing the Pitch Flow or re‑approving it. See the "Copy Node URL" control on the nodes in your funnel builder for reference.

### Best Practices for Pitch Flow Setup

* **Include all variants**: Add every product combination you might test
* **Avoid re-approval delays**: Having all variants pre-approved saves time
* **Organize logically**: Group related products together
* **Document variants**: Keep track of which IDs correspond to which products

## Step 4: Configure Funnel Integration

### Set Funnel Pitch Flow ID

1. Go to **Funnels** → **Edit Funnel**
2. In the funnel settings, you'll see:
   * **ClickBank Pitch Flow ID**: Enter your CBFID
   * **ClickBank Template Code**: Enter if using custom templates
3. Save the funnel configuration

### Default Funnel Setup

* **Make funnel default**: Check this option if you want this funnel to handle all traffic to the domain without the `f=` parameter
* **URL access**: Visitors can access via `domain.com` or `domain.com?f=funnel_id`

## Postbacks

Use the **Setup** modal in the **Merchants** list for step-by-step, up-to-date postback instructions and your unique URL. After you configure ClickBank and trigger a test (or run a test purchase), the modal will automatically mark the connection as validated once the webhook is received.

## Advanced Configuration

### Multiple Product Testing

When split testing different products:

1. **Add all products** to the same pitch flow in ClickBank
2. **Use page events** to show different purchase buttons
3. **Pass product IDs** in the purchase links
4. **Track performance** of each variant

### Custom Purchase Links

Purchase links automatically use the funnel's CBFID:

* **Standard format**: `[BUY=product_code]`
* **With parameters**: `[BUY=product_code extra=campaign_data]`
* **No manual CBFID**: System automatically adds the funnel's pitch flow ID

### Upsell Configuration

1. **Create upsell nodes** in your funnel
2. **Connect to purchase nodes** for the main product
3. **Use funnel-level split testing** or page events for upsell variants
4. **Configure decline flows** for users who don't purchase upsells

### Subscription Upsells (Upgrade/Cancel)

If you sell recurring products, you can upgrade or cancel a customer's existing subscription mid-funnel using `[UPSELL_UPGRADE=old_sku, new_sku]` and `[UPSELL_CANCEL]` tags. This requires a **Developer API Key** (different from the encryption key) - see [Subscription Upsells](/products/subscription-upsells) for full setup instructions.

## Troubleshooting

### Common Issues

**Postback not working:**

* Verify encryption key matches in both systems
* Check postback URL is correctly entered in ClickBank
* Ensure merchant is properly assigned to domain

**Purchase links not working:**

* Verify funnel has correct CBFID
* Check that merchant is assigned to the domain
* Ensure products exist in ClickBank pitch flow

**Split testing not working:**

* Verify all product variants are in the pitch flow
* Check that page events are properly connected
* Ensure domain-merchant assignment is correct

### Testing Your Setup

1. **Use ClickBank's test mode** for initial testing
2. **Verify postback reception** in ElasticFunnels
3. **Test purchase flow** end-to-end
4. **Check conversion tracking** in both systems

## Security Best Practices

* **Keep encryption keys secure** - don't share them
* **Use strong, unique keys** - avoid simple passwords
* **Regularly rotate keys** - update periodically for security
* **Monitor postback logs** - watch for unusual activity
* **Test with small amounts** - verify everything works before full launch

<Warning>
  Ensure all your ClickBank pitch flow products are compliant with ClickBank's marketplace policies. Non-compliant products can result in account suspension.
</Warning>
