> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.vturb.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Tracking Conversion - Clickbank (Affiliate)

# Tracking Your Sales with Clickbank (Affiliate)

This article explains how to set up VTurb conversion tracking and how to integrate this functionality with Clickbank.

### Go to Conversion Tracking in VTurb and Select Clickbank.

Click on **Settings** and then on **Conversion Tracking.**

If you haven’t integrated with any platform yet, you will see the following screen:

![Initial Conversion Tracking State](https://storage.crisp.chat/users/helpdesk/website/-/3/9/0/a/390a843820d6ba00/image_1vwcxsc.png)

Then click the **Add platform** button.

Next, select **Clickbank and click **Continue**

![](https://storage.crisp.chat/users/helpdesk/website/-/3/9/0/a/390a843820d6ba00/image_p1au65.png)


Then, select a tracking parameter that is **NOT being used in your traffic sources and click Confirm.**

||| Pay attention to the following Clickbank limitation: They limit the number of webhook (INS) URLs to 2 per account. If you need more, contact their Support via chat to increase this limit.


|| If you choose a parameter that is currently being used in your ads, VTurb will overwrite it. 


| IMPORTANT: Affiliates must use the parameter unique_aff_sub; Producers can only use the parameter vtid.

**We recommend using unique_aff_sub5 if you are also using Utmify**

![](https://storage.crisp.chat/users/helpdesk/website/-/3/9/0/a/390a843820d6ba00/image_f80jdc.png =1100x423)

Now, just click on the **&#160;Webhook URL** field to copy the URL that will be used in the next step

![](https://storage.crisp.chat/users/helpdesk/website/-/3/9/0/a/390a843820d6ba00/image_16p5c5q.png)

| If you use RedTrack, you must choose a sub parameter (we provide sub1 to sub20) and make some configurations in RedTrack.

[Click here](https://help.vturb.com/pt-br/article/rastreando-a-conversao-redtrack-1f3z4rc/) to learn more about the RedTrack integration.

### Configuring the Webhook in Clickbank

1. Click on the **Accounts** section and select your account.

![](https://storage.crisp.chat/users/helpdesk/website/390a843820d6ba00/image_1ww6i3w.png =150xauto)

![](https://storage.crisp.chat/users/helpdesk/website/390a843820d6ba00/image_8ac58b.png =692xauto)

2. A new page will open; click on **Vendor Settings**.

![](https://storage.crisp.chat/users/helpdesk/website/390a843820d6ba00/image_9jykrz.png =874xauto)

3. Scroll down to **ADVANCED TOOLS** > Click **Edit**.

![](https://storage.crisp.chat/users/helpdesk/website/390a843820d6ba00/image_1bqf3cn.png =1080xauto)

4. Fill out the form, review the terms of use, and confirm that you have read and agree to the terms.

5. Create a secret key.

6. Enter the VTurb webhook URL in the **Instant Notification URL** field.

![](https://storage.crisp.chat/users/helpdesk/website/390a843820d6ba00/image_l1pic1.png =1015xauto)

7. After saving, copy your secret key and paste it into VTurb under the Clickbank integration.

![](https://storage.crisp.chat/users/helpdesk/website/390a843820d6ba00/image_c42xvv.png =1047xauto)

### Configure your hoplink in Clickbank

For affiliate tracking to work correctly, it is also necessary to configure the offer hoplink. Below we show the step-by-step process.

1. Go to Affiliate Link Tools.
2. Define the affiliate nickname and the producer nickname.
3. Check the Hoplink option
4. Click Edit parameters
5. Keep all aff_sub and unique_aff_sub checked, only them. The other parameters can be unchecked.
Example:

![](https://storage.crisp.chat/users/helpdesk/website/-/3/9/0/a/390a843820d6ba00/image_9z06im.png =872xauto)

6. After that, copy your hoplink here:

![](https://storage.crisp.chat/users/helpdesk/website/-/3/9/0/a/390a843820d6ba00/image_gcx4zm.png =760xauto)

7. With the hoplink in hand, paste it into the code below in YOUR HOPLINK:

```
    <script>
      (function () {
        var hopBase = "YOUR HOPLINK";

        function getParam(name) {
          try {
            return new URL(window.location.href).searchParams.get(name) || "";
          } catch (e) {
            return "";
          }
        }

        function extractId(value) {
          if (!value) return "";
          var parts = value.split("|");
          return parts.length > 1 ? parts[parts.length - 1] : parts[0];
        }

        function buildAndFireHopLink(vturbCk) {
          var utm_source = extractId(getParam("utm_source"));
          var utm_campaign = extractId(getParam("utm_campaign"));
          var utm_medium = extractId(getParam("utm_medium"));
          var utm_content = extractId(getParam("utm_content"));
          var utm_term = extractId(getParam("utm_term"));

          var hopUrlObj = new URL(hopBase);

          // Copia todos os parâmetros da URL atual para a hop URL
          try {
            var currentParams = new URL(window.location.href).searchParams;
            currentParams.forEach(function (value, key) {
              if (!hopUrlObj.searchParams.has(key)) {
                hopUrlObj.searchParams.set(key, value);
              }
            });
          } catch (e) {}

          // Adiciona aff_sub e unique_aff_sub apenas se não existirem
          var affSubs = {
            aff_sub1: utm_source || vturbCk || "",
            aff_sub2: utm_campaign || vturbCk || "",
            aff_sub3: utm_medium || vturbCk || "",
            aff_sub4: utm_content || vturbCk || "",
            aff_sub5: vturbCk || utm_term || "",
            unique_aff_sub1: utm_source || vturbCk || "",
            unique_aff_sub2: utm_campaign || vturbCk || "",
            unique_aff_sub3: utm_medium || vturbCk || "",
            unique_aff_sub4: utm_content || vturbCk || "",
            unique_aff_sub5: vturbCk || utm_term || "",
          };

          for (var key in affSubs) {
            if (!hopUrlObj.searchParams.has(key)) {
              hopUrlObj.searchParams.set(key, affSubs[key]);
            }
          }

          var hopUrl = hopUrlObj.toString();

          var iframe = document.createElement("iframe");
          iframe.src = hopUrl;
          iframe.width = "0";
          iframe.height = "0";
          iframe.style.cssText =
            "display:none;width:0;height:0;border:0;position:absolute;left:-9999px;";
          iframe.setAttribute("tabindex", "-1");
          iframe.setAttribute("aria-hidden", "true");
          iframe.setAttribute("title", "");

          if (document.body) {
            document.body.appendChild(iframe);
          } else {
            document.addEventListener("DOMContentLoaded", function () {
              document.body.appendChild(iframe);
            });
          }

          console.log("[HopLink] IDs extracted:", {
            aff_sub1: utm_source,
            aff_sub2: utm_campaign,
            aff_sub3: utm_medium,
            aff_sub4: utm_content,
            aff_sub5: vturbCk || utm_term,
          });
          console.log("[HopLink] URL:", hopUrl);
        }

        var player = document.querySelector("vturb-smartplayer");

        player.addEventListener("player:ready", async function () {
          try {
            var url = await player.urlUpdater("https://placeholder.com");
            var parsedUrl = new URL(url);
            var paramns = player.config.conversion;
            var vturbCk = "";
            paramns.forEach((param) => {
              var value = parsedUrl.searchParams.get(param);
              if (value) {
                vturbCk = value;
              }
            });
            buildAndFireHopLink(vturbCk);
          } catch (e) {
            console.warn("[HopLink] Error in get urlUpdater:", e);
            buildAndFireHopLink("");
          }
        });
      })();
    </script>
```

9. After that, copy all the code and paste it into your sales page HTML. You can place it in the body or below the video code  
And that’s it, your Clickbank integration is successfully completed!


Now the conversions from your videos that sell through Clickbank will be tracked inside VTurb.

| **If you use pop-ups on your page, a specific configuration is required to ensure parameters are passed correctly. Contact us via Chat to receive these instructions!**

If you have any questions or need support during the process, our team is available to help!

To learn more about Conversion Tracking, just click the link below:

[Conversion Tracking](https://help.vturb.com/pt-br/article/rastreamento-de-conversoes-1ms9vqq/)