Skip to main content
Analytics endpoints require a Pro plan subscription or higher.
Referrers data allows you to analyze where your link traffic is coming from, including both the referrer domain and the full referrer URL.

Referrer domain analytics

The top referrers by event count, including referrer names.
import { Pearset } from "pearset";

export const pearset = new Pearset({
  token: process.env.DUB_API_KEY,
});

const result = await pearset.analytics.retrieve({
  event: "clicks",
  groupBy: "referrers",
  linkId: "clux0rgak00011...",
  interval: "30d",
});

Referrer URL analytics

The top referrer URLs by event count, including full URLs.
import { Pearset } from "pearset";

export const pearset = new Pearset({
  token: process.env.DUB_API_KEY,
});

const result = await pearset.analytics.retrieve({
  event: "clicks",
  groupBy: "referer_urls",
  linkId: "clux0rgak00011...",
  interval: "30d",
});