How to connect AFF1 to the Keitaro tracker

7 min read Read in: Русский
On this page
  1. Before you start
  2. Add AFF1 as an affiliate network
  3. Get the AFF1 flow link
  4. Create the offer in Keitaro
  5. Create a campaign and a flow
  6. Get the Keitaro postback URL
  7. Create the postback in AFF1
  8. Check that it works
  9. Common problems
  10. Related articles

Keitaro is a tracker that you install on your own server. Your ads send visitors to a Keitaro campaign, Keitaro redirects them to your AFF1 flow link, and AFF1 reports every lead status back to Keitaro by postback. This guide is for the current Keitaro version (v11).

Keitaro and AFF1 both use the word “flow”. In Keitaro, flows are traffic rules inside a campaign (older Keitaro versions called them “streams”). In this article, “AFF1 flow” means the flow in your AFF1 account, and “Keitaro flow” means the flow inside a Keitaro campaign.

Before you start

How the data moves:

  1. Keitaro creates a click ID for every visitor. Its macro is {subid}.
  2. Keitaro sends the visitor to the AFF1 flow link and adds clickid={subid} to it. AFF1 saves this value as the external click ID.
  3. When the lead is created, approved or cancelled, AFF1 sends a postback with the {clickid} token. Keitaro finds the click by this value and records the conversion.

Add AFF1 as an affiliate network

  1. In Keitaro, open Affiliate Networks and click Create.
  2. Open the From template list and look for AFF1 (Aff1.com). If it is in the list, select it: the fields are filled in automatically.
  3. If there is no AFF1 template, enter AFF1 in Name and clickid={subid} in Offer parameters. Leave Postback URL as it is: in Keitaro this field is only a note for you and does not change how the tracker works.
  4. Check Offer parameters in any case. It must be clickid={subid}: AFF1 accepts the external click ID only in the clickid parameter.
  5. Click Create.

Keitaro adds Offer parameters to the URL of every offer that uses this affiliate network. You do not need to add clickid to the AFF1 link yourself.

  1. In AFF1, open Tools → Flows. In the row of your flow, open the ••• menu and select Get link.
  2. In Choose domain for traffic, select a domain.
  3. Leave Use clickid for external tracker integration off. Keitaro adds clickid={subid} from the affiliate network settings.
  4. Optional: turn on Use data parameters and enter Keitaro macros, for example {campaign_id} in data1. You will see these values in AFF1 statistics.
  5. Copy the Traffic link. It looks like http://<domain>/?flow_hash=<hash>.

If you did not put clickid={subid} into Offer parameters, do it the other way: turn on Use clickid for external tracker integration and enter {subid} in the clickid field. Use only one of the two ways.

AFF1 link dialog with the clickid option turned on
The clickid option in AFF1. Use it only if Keitaro does not add clickid itself.

Create the offer in Keitaro

  1. Open Offers and click Create.
  2. On the Main tab, enter the Offer name (for example, the offer name and GEO) and select AFF1 in Affiliate network.
  3. Select Redirect and paste the AFF1 traffic link into URL.
  4. On the Settings tab, select CPA (per action) in Payout type. In Payout, keep From param ‘payout’ turned on: Keitaro takes the amount from the AFF1 postback.
  5. Click Create.

The Countries field of the offer is only a note in Keitaro. To filter traffic by country, use filters in the Keitaro flow.

Create a campaign and a flow

  1. Open Campaigns and click Create.
  2. On the General tab, select your Domain. Keitaro fills in the Alias (you can change it). In Source, select your traffic source template if you use one.
  3. Click Create Flow. On the Main tab of the Edit Flow window, enter the Flow name.
  4. On the Schema tab, select Landing pages & offers, click Add offers and select the offer you created.
  5. Optional: on the Filters tab, add the Country filter with the offer GEO.
  6. Click Apply.
  7. Save the campaign with the green button in the top right corner.
  8. Open the Tracking tab and copy the Campaign URL. This is the link for your traffic source.

Put the Keitaro Campaign URL into your ads, not the AFF1 link. If visitors go to AFF1 directly, Keitaro has no click and no subid, and it cannot record the conversion.

Get the Keitaro postback URL

  1. In Keitaro, open Settings → Postback URL.
  2. Copy the URL. It looks like http://<server-ip>/<postback-key>/postback?subid=REPLACE&status=REPLACE&payout=REPLACE.
  3. Keep the part before ?. You can replace the server IP with any domain added to Keitaro with the OK status, for example https://tracker.example.com/<postback-key>/postback.

Create the postback in AFF1

Keitaro v11 ignores a postback without the status parameter. AFF1 sends the event in the {type} token with the values lead_add, lead_approve and lead_cancel. Keitaro does not know these values, so the URL also contains three “training” parameters: lead_status, sale_status and rejected_status. They tell Keitaro which AFF1 value means which conversion type.

Use this URL with your domain and postback key:

https://tracker.example.com/<postback-key>/postback?subid={clickid}&status={type}&payout={payout}&currency={currency}&lead_status=lead_add&sale_status=lead_approve&rejected_status=lead_cancel
AFF1 event{type} valueKeitaro conversion type
Creating leadlead_addLead (revenue in hold)
Confirming leadlead_approveSale (confirmed revenue)
Cancelling leadlead_cancelRejected
  • subid={clickid} returns the Keitaro click ID that AFF1 received in clickid.
  • payout={payout} is the amount in the offer currency; currency={currency} is USD or EUR. Keitaro converts the amount to the tracker currency.
  1. In AFF1, open Tools → Flows and open your flow.
  2. In the Postback section, click Create postback.
  3. Type: s2s.
  4. Select Creating lead, Confirming lead and Cancelling lead.
  5. Paste the URL into URL.
  6. Request method: GET.
  7. Click Add. The postback is saved at once.
AFF1 Creating postback window, type s2s
Postback form in the AFF1 flow. Add the three training parameters to the URL.

If all your AFF1 flows go through the same Keitaro, you can add this URL once in Account Settings → Global postback. See Postback.

Check that it works

  1. Open the Keitaro Campaign URL in your browser. The AFF1 landing must open, and the click must appear in the campaign statistics.
  2. When the first lead comes, open Maintenance → Logs → Postbacks in Keitaro. You must see a Received postback line with a real subid value and status=lead_add.
  3. Open Reports → Conversions. The conversion has the type Lead, and the Status column shows the original AFF1 value (lead_add).
  4. In AFF1, open Tools → Postback logs to see which postbacks AFF1 sent and to which URL. If Keitaro was unavailable, use Resend postbacks for the needed dates.

A test postback without a real Keitaro click does not work: Keitaro needs a real subid. If you want to test with a lead before you buy traffic, ask your personal manager how to do it on your offer.

Common problems

Keitaro log shows Postback status is not set. The URL has no status={type}. Add it.

Keitaro log shows Conversion type not found. The training parameters are missing or have a typo. Check that the URL ends with &lead_status=lead_add&sale_status=lead_approve&rejected_status=lead_cancel.

Keitaro log shows Click for subid ... not found. The click ID did not come back. Check:

  • The macro in Offer parameters (or in the AFF1 clickid field) is exactly {subid}: lowercase, in curly braces. With a typo, AFF1 saves the text instead of the click ID.
  • In the AFF1 postback URL you use the AFF1 token: subid={clickid}, not subid={subid}.
  • Your ads point to the Keitaro Campaign URL, not to the AFF1 link.

clickid appears twice in the offer URL. You added it both in Offer parameters and in the AFF1 link. Keep it in one place only.

Keitaro log shows Incorrect postback code. The postback key in the URL is wrong. Copy it again from Settings → Postback URL.

Nothing in the Keitaro postback log. Open Tools → Postback logs in AFF1 and check that the postback was sent and the URL is correct. AFF1 accepts only URLs that point to a public address.

Trash leads show as Rejected. This is expected. AFF1 sends trash as a cancellation: {type} = lead_cancel and {substatus} = trashed.

Still have questions?

Your personal manager and AFF1 support answer in Telegram 24/7.