Partner API / Tracking campaigns
Tracking campaigns
Tag every link by where you post it, so the product's analytics can tell your campaigns apart.
curl -X POST https://api.affiliatepipe.com/v1/links \
-H "Authorization: Bearer $AP_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://greyhoundapi.com/pricing", "utm_source": "youtube", "utm_medium": "video", "utm_campaign": "race-day"}'$ch = curl_init('https://api.affiliatepipe.com/v1/links');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('AP_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"url": "https://greyhoundapi.com/pricing", "utm_source": "youtube", "utm_medium": "video", "utm_campaign": "race-day"}',
]);
$data = json_decode(curl_exec($ch), true);import os, requests
r = requests.post(
"https://api.affiliatepipe.com/v1/links",
headers={"Authorization": "Bearer " + os.environ["AP_KEY"]},
json={"url": "https://greyhoundapi.com/pricing", "utm_source": "youtube", "utm_medium": "video", "utm_campaign": "race-day"},
)
data = r.json()const r = await fetch("https://api.affiliatepipe.com/v1/links", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.AP_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({"url": "https://greyhoundapi.com/pricing", "utm_source": "youtube", "utm_medium": "video", "utm_campaign": "race-day"}),
});
const data = await r.json();- Source is where it is posted (youtube, discord, newsletter). Medium is the kind of placement (video, social, email). Campaign is your name for the push (race-day).
- Commission is tracked by your partner code, with or without tags. Tags are for your own reporting.
- The same builder is on your Links tab, if you would rather not write code.