Register click
curl --request POST \
--url https://api.example.com/v1/analytics/register_clickimport requests
url = "https://api.example.com/v1/analytics/register_click"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/analytics/register_click', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/analytics/register_click",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/analytics/register_click"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/analytics/register_click")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/analytics/register_click")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"status": 1
}
Analytics
Register click
Count a referral link click from your server so it appears in partner and link click statistics — for sites that don’t run PartneroJS.
POST
/
v1
/
analytics
/
register_click
Register click
curl --request POST \
--url https://api.example.com/v1/analytics/register_clickimport requests
url = "https://api.example.com/v1/analytics/register_click"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/analytics/register_click', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/analytics/register_click",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/analytics/register_click"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/analytics/register_click")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/analytics/register_click")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"status": 1
}
Endpoint
POST https://api.partnero.com/v1/analytics/register_click
Clicks are only counted by PartneroJS or this endpoint. Referral link redirects through a tracking domain and the keyless click registration endpoint (
/pub/v1/s2s/clicks/{pub_id}) generate a postback click ID, but they don’t add to click statistics. If you rely on either of them without PartneroJS, call this endpoint as well.Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
referral_key | string | Yes | The referral key from the landing URL (for example john from ?aff=john). Accepts a partner’s default key or the key of any of their custom referral links; the click is counted on the matching link |
url | string | Yes | The full landing page URL the visitor arrived on, including the query string. Must be a valid absolute URL. Query parameters your program tracks (such as UTM tags) are recorded from it |
Request
cURL
curl --location 'https://api.partnero.com/v1/analytics/register_click' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"referral_key": "john",
"url": "https://your-site.com/pricing?aff=john&utm_source=newsletter"
}'
Response
{
"status": 1
}
{"status": 1} once the request is accepted — including when the referral key doesn’t match a partner, or url is missing or invalid. Those clicks are silently discarded. Processed clicks usually appear in statistics within a minute.
Usage notes
- Call it once per referred landing, not on every page view. Each request counts as one click; there is no deduplication.
- Only call it for referred visits — when the landing URL contains your program’s referral parameter.
- Call it from your backend. The endpoint requires your secret API key, which must never be exposed in browser or mobile code.
app.get('*', async (req, res, next) => {
const aff = req.query.aff;
if (aff && !req.session.partneroClickRegistered) {
req.session.affiliateKey = aff;
req.session.partneroClickRegistered = true;
fetch('https://api.partnero.com/v1/analytics/register_click', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.PARTNERO_API_KEY}`
},
body: JSON.stringify({
referral_key: aff,
url: `${req.protocol}://${req.get('host')}${req.originalUrl}`
})
}).catch(() => {});
}
next();
});
Was this page helpful?
