Skip to main content

shortUrlAnalytics

Requires at least one of the permissions marketing:link:read, marketing:link:write or settings:integration:read.

Returns click statistics for one short link: total and unique clicks, and clicks by date, country, device and browser. Fails if the link does not exist. Needs the marketing links read or write permission, or the integration settings read permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query ShortUrlAnalytics($idOrCode: String!) {
shortUrlAnalytics(idOrCode: $idOrCode) {
totalClicks
uniqueClicks
clicksByBrowser {
browser
count
}
}
}

Variables:

{
"idOrCode": "string"
}

Response:

{
"data": {
"shortUrlAnalytics": {
"totalClicks": 0,
"uniqueClicks": 0,
"clicksByBrowser": [
{
"browser": "string",
"count": 0
}
]
}
}
}
shortUrlAnalytics(
idOrCode: String!
): ShortUrlAnalytics!

Arguments​

shortUrlAnalytics.idOrCode ● String! non-null scalar​

The ID, the short code or the custom alias of the short link.

Type​

ShortUrlAnalytics object​

How a short link was used.