Files
dub-node/docs/sdks/analytics

Analytics

(analytics)

Available Operations

  • timeseries - Retrieve timeseries click analytics ⚠️ Deprecated Use timeseries instead.
  • country - Retrieve top countries by clicks ⚠️ Deprecated Use countries instead.
  • city - Retrieve top cities by clicks ⚠️ Deprecated Use cities instead.
  • device - Retrieve top devices by clicks ⚠️ Deprecated Use devices instead.
  • browser - Retrieve top browsers by clicks ⚠️ Deprecated Use browsers instead.
  • os - Retrieve top OS by clicks ⚠️ Deprecated Use os instead.
  • referer - Retrieve top referers by clicks ⚠️ Deprecated Use referers instead.
  • topLinks - Retrieve top links by clicks ⚠️ Deprecated Use topLinks instead.
  • topUrls - Retrieve top URLs by clicks ⚠️ Deprecated Use topUrls instead.

timeseries

Retrieve timeseries click analytics for a link, a domain, or the authenticated workspace over a period of time.

⚠️ DEPRECATED: This method is deprecated. Use dub.analytics.clicks.timeseries instead.. Use timeseries instead.

Example Usage

import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
  workspaceId: "<value>",
});

async function run() {
  const result = await dub.analytics.timeseries({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetTimeseriesByClicksDeprecatedRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetTimeseriesByClicksDeprecatedResponseBody[]>

Errors

Error Object Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4xx-5xx /

country

Retrieve the top countries by number of clicks for a link, a domain, or the authenticated workspace.

⚠️ DEPRECATED: This method is deprecated. Use dub.analytics.clicks.countries instead.. Use countries instead.

Example Usage

import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
  workspaceId: "<value>",
});

async function run() {
  const result = await dub.analytics.country({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetCountriesByClicksDeprecatedRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetCountriesByClicksDeprecatedResponseBody[]>

Errors

Error Object Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4xx-5xx /

city

Retrieve the top countries by number of clicks for a link, a domain, or the authenticated workspace.

⚠️ DEPRECATED: This method is deprecated. Use dub.analytics.clicks.cities instead.. Use cities instead.

Example Usage

import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
  workspaceId: "<value>",
});

async function run() {
  const result = await dub.analytics.city({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetCitiesByClicksDeprecatedRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetCitiesByClicksDeprecatedResponseBody[]>

Errors

Error Object Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4xx-5xx /

device

Retrieve the top devices by number of clicks for a link, a domain, or the authenticated workspace.

⚠️ DEPRECATED: This method is deprecated. Use dub.analytics.clicks.devices instead.. Use devices instead.

Example Usage

import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
  workspaceId: "<value>",
});

async function run() {
  const result = await dub.analytics.device({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetDevicesByClicksDeprecatedRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetDevicesByClicksDeprecatedResponseBody[]>

Errors

Error Object Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4xx-5xx /

browser

Retrieve the top browsers by number of clicks for a link, a domain, or the authenticated workspace.

⚠️ DEPRECATED: This method is deprecated. Use dub.analytics.clicks.browsers instead.. Use browsers instead.

Example Usage

import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
  workspaceId: "<value>",
});

async function run() {
  const result = await dub.analytics.browser({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetBrowsersByClicksDeprecatedRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetBrowsersByClicksDeprecatedResponseBody[]>

Errors

Error Object Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4xx-5xx /

os

Retrieve the top OS by number of clicks for a link, a domain, or the authenticated workspace.

⚠️ DEPRECATED: This method is deprecated. Use dub.analytics.clicks.os instead.. Use os instead.

Example Usage

import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
  workspaceId: "<value>",
});

async function run() {
  const result = await dub.analytics.os({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetOSByClicksDeprecatedRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetOSByClicksDeprecatedResponseBody[]>

Errors

Error Object Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4xx-5xx /

referer

Retrieve the top referers by number of clicks for a link, a domain, or the authenticated workspace.

⚠️ DEPRECATED: This method is deprecated. Use dub.analytics.clicks.referers instead.. Use referers instead.

Example Usage

import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
  workspaceId: "<value>",
});

async function run() {
  const result = await dub.analytics.referer({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetReferersByClicksDeprecatedRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetReferersByClicksDeprecatedResponseBody[]>

Errors

Error Object Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4xx-5xx /

Retrieve the top links by number of clicks for a domain or the authenticated workspace.

⚠️ DEPRECATED: This method is deprecated. Use dub.analytics.clicks.topLinks instead.. Use topLinks instead.

Example Usage

import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
  workspaceId: "<value>",
});

async function run() {
  const result = await dub.analytics.topLinks({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetTopLinksByClicksDeprecatedRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetTopLinksByClicksDeprecatedResponseBody[]>

Errors

Error Object Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4xx-5xx /

topUrls

Retrieve the top URLs by number of clicks for a given short link.

⚠️ DEPRECATED: This method is deprecated. Use dub.analytics.clicks.topUrls instead.. Use topUrls instead.

Example Usage

import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
  workspaceId: "<value>",
});

async function run() {
  const result = await dub.analytics.topUrls({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetTopURLsByClicksDeprecatedRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<operations.GetTopURLsByClicksDeprecatedResponseBody[]>

Errors

Error Object Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4xx-5xx /