Skip to main content
Clickbank integration

How to integrate Kit and Clickbank.

Updated over a month ago

With our Clickbank integration, you can sync your Clickbank product buyers' email addresses to Kit and add specific Tags to them.

The integration works by placing a PHP script on your server. To configure it, you will need to access your Clickbank vendor settings, edit a PHP script (or several, if you have multiple Clickbank accounts), and then add this script to your site via FTP.

1. Set your INS settings in Clickbank

INS stands for Instant Notification Service. If you have already enabled this for a previous integration, you can replace your previous integration (if it was for another email service) or add a second INS URL. You can have up to two.

To set your INS settings, go to Accounts in the Clickbank dashboard's left sidebar and click your sales account nickname.

Select Vendor Settings > My Site at the top of the page that opens in a new tab:

Scroll down to the Advanced Tools section and click Edit.

Then, enter a secret key and save your changes. The secret key can be any string of numbers or letters. It just has to match what you put in your PHP script later.

The next step is to set your Instant Notification URL. Click request access to request access to this setting if needed.

Once you have access, you'll be able to fill out your URL:

This URL will be your script's destination on your server. We recommend creating a "Clickbank" folder first and then adding all Clickbank scripts there. If you do that, your URL will look like this: http://yoursite.com/clickbank/clickbank-hook.php

Leave the version set to 6.0, and don't click Test IPN yet. Save your changes.

2. Configure the PHP script

Download the PHP script using the relevant link:

We'll be editing the following values in the script:

  • Your Kit API Key

  • Clickbank Product IDs

  • Kit Tag IDs

  • Default Tag

  • Your Clickbank sales account nickname

  • Your ClickBank INS Key

Open the script in a text editor, making sure to edit it in plain text mode. Editing it in rich text mode can add curly quotes that will break the script.

Replace your-kit-api-key in the script with your Kit API Key. Be careful not to delete the quotes surrounding your-kit-api-key.

To find your API Key, click your account name at the top right of the navigation in Kit, followed by Settings.

On the lefthand navigation, you'll see the Developers tab. Click it to copy your V3 API Key.

Map your Clickbank products to Kit Tags

Now, you'll map your Clickbank product IDs to Kit Tag IDs.

Here's how to find your Clickbank product's ID:

  • Go to Accounts in the Clickbank dashboard's left sidebar and click your sales account, and then

  • Select Vendor Settings > My Products at the top of the page that opens in a new tab

Your product's ID corresponds to its Item Number.

If you haven't created your Kit Tags already, do this first. Then, get their Tag ID:

Click your Tag in Kit and look for the number after subscribable_ids= in your browser's address bar:

This number is the Kit Tag's ID.

Now, go back to your script and:

  • Replace clickbankproduct1, clickbankproduct2, and clickbankproduct3 with your Clickbank products' IDs, and

  • Replace cktag1, cktag2, and cktag3 with the ID of the Kit Tag that should be associated with these products. Multiple products can be tagged with the same Kit Tag.

Feel free to duplicate the lines if you need to map more than three Clickbank products to Kit Tags, or delete unnecessary lines if you're mapping fewer than three products.

You will also need to replace tag-to-use-if-product-is-not-in-list with the ID for a default Tag that will be mapped to products that haven't been mapped to any Kit Tag IDs. The default Tag can be a new Tag or one of the same Tags you're using for other products.

This part of your script should look something like this:

Finally, replace your-clickbank-username with your Clickbank sales account nickname and your-clickbank-INS-key with the secret key you set up when configuring your INS earlier.

Save the changes to your script.

3. Place the script on your server

This step requires that you use FTP to add the script to your server.

We recommend creating a "Clickbank" folder in your server to keep all your Clickbank scripts together. This is especially true if you have multiple Clickbank accounts.

Use your preferred FTP application to upload the script to your server. The script's destination should be the same as the URL you provided in your INS settings in step 1.

Once you've uploaded your script, this integration is live and will work right away!

4. Test the integration

The best way to ensure everything is working is to do a test purchase.

Clickbank lets you create a test credit card number for the purchase. To do this, go to Accounts in the Clickbank dashboard's left sidebar and click your sales account.

Then, select Vendor Settings > My Site at the top of the page that opens in a new tab.

Scroll down to the Testing Your Products section and click Edit to generate a test credit card number.

Once you've generated a test credit card number, open a new browser tab and type the direct link to purchase your Clickbank product.

The link's structure is [product ID].[your Clickbank sales account nickname].pay.clickbank.net. For example, 1.nbarry.pay.clickbank.net.

Purchase your product using the test credit card number and your email address.

TIP: If you're using a Gmail address, you can add "+" to your email address to specify what product you are testing, like "[email protected]" instead of "[email protected]." This can come in handy if your email address is already subscribed to many Tags in your Kit account.

After that, check whether your email address has been added to your Kit account and tagged with the right Tag for your product.

Did this answer your question?