GET
/
partners
/
analytics
from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.partners.analytics(request={
        "program_id": "<id>",
    })

    assert res is not None

    # Handle response
    print(res)
{
  "clicks": 0,
  "leads": 0,
  "sales": 0,
  "saleAmount": 0,
  "earnings": 0
}

Partners endpoints require an Advanced plan subscription or higher.

Authorizations

Authorization
string
header
required

Default authentication mechanism

Query Parameters

partnerId
string

The ID of the partner to retrieve analytics for.

tenantId
string

The ID of the tenant that created the link inside your system.

interval
enum<string>

The interval to retrieve analytics for. If undefined, defaults to 24h.

Available options:
24h,
7d,
30d,
90d,
1y,
mtd,
qtd,
ytd,
all
start
string

The start date and time when to retrieve analytics from. Takes precedence over interval.

end
string

The end date and time when to retrieve analytics from. If not provided, defaults to the current date. Takes precedence over interval.

timezone
string
default:UTC

The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC.

Example:

"America/New_York"

groupBy
enum<string>
default:count

The parameter to group the analytics data points by. Defaults to count if undefined.

Available options:
top_links,
timeseries,
count
programId
string
required

The ID of the program to retrieve analytics for.

Response

200
application/json
Partner analytics data
clicks
number
default:0
required

The total number of clicks

leads
number
default:0
required

The total number of leads

sales
number
default:0
required

The total number of sales

saleAmount
number
default:0
required

The total amount of sales, in cents

earnings
number
default:0
required