Skip to content

Widget statistics per widget

GET
https://api.getsitecontrol.com/v1/sites/{site_id}/widgets/stats/by-widget
curl --request GET \
--url https://api.getsitecontrol.com/v1/sites/1/widgets/stats/by-widget \
--header 'Authorization: Bearer <token>'

Event counts per widget, in one of two ways.

With widget_ids (up to 100, from list_widgets): every listed live widget of the site in the order given, zeros without events; repeated ids count once, unknown, deleted and foreign ids are left out. The period is optional here: without from and to the numbers cover the whole life, and period is null.

Without widget_ids the period is required: the live widgets with events in the period, most shown first. Deleted widgets and events without a widget are left out, so the sum may be below get_widgets_stats.

folder_id, is_active, layout and search narrow either way to the widgets that match every one given, and then every matched widget is listed, zero ones too: one call gives the numbers of a folder or of the active widgets. total is the sum of the listed widgets; use it rather than adding the items up.

Counts: show is the widget shown to a visitor (a view), submit a form sent, openUrl a button or link opening a URL, showWidget a button opening another widget, addToCart, applyCoupon and copyToClipboard the matching cart and coupon buttons. rates next to each total gives every action counter divided by show, rounded to 4 places (rates.submit is the conversion rate); a rate is null when show is 0, as it is undefined, not zero.

FieldDescription
site_id
required
Site Id
integer
FieldDescription
widget_ids
Widget Ids

Widget ids from list_widgets, up to 100; repeat for several. With them the period is optional

Array<integer>
<= 100 items

Widget ids from list_widgets, up to 100; repeat for several. With them the period is optional

from
From

UTC day, included; omit for the whole life

string format: date

UTC day, included; omit for the whole life

to
To

UTC day, included; with from, today when omitted

string format: date

UTC day, included; with from, today when omitted

is_active
Is Active

True: only widgets that are on; false: only off

boolean

True: only widgets that are on; false: only off

layout

Only widgets of this layout; use it only when the user names one

string
Allowed values: modal bar panel slide_in sidebar fullscreen inline

Only widgets of this layout; use it only when the user names one

search
Search

Part of the name, the id, or words of the widget’s own text

string
>= 1 characters <= 255 characters

Part of the name, the id, or words of the widget’s own text

folder_id
Folder Id

Only the items of this folder, an id from list_folders; 0 is General

integer

Only the items of this folder, an id from list_folders; 0 is General

Successful Response

Media typeapplication/json
WidgetStatsBreakdown
object
FieldDescription
period
Period

Null when the numbers cover the whole life of the widgets

object
FieldDescription
date_from
required
Date From

First day, UTC, included

string format: date
date_to
required
Date To

Last day, UTC, included

string format: date
matched
Matched

How many live widgets the filters or ids matched; null without them. 0 means nothing matched, not that nothing happened: check the filters or ids

integer
nullable
total
required
Total

The counters of the listed widgets summed: the numbers of the set, use them rather than adding the items up

object
FieldDescription
show
required
Show
integer
submit
required
Submit
integer
openUrl
required
Openurl
integer
showWidget
required
Showwidget
integer
addToCart
required
Addtocart
integer
applyCoupon
required
Applycoupon
integer
copyToClipboard
required
Copytoclipboard
integer
rates
required
Rates

Each action counter of total divided by show, so the conversion rate is rates.submit; every key is always present, null when show is 0

object
FieldDescription
submit
Submit

submit / show; null when there were no shows: the rate is undefined, not zero

number
nullable
openUrl
Openurl

openUrl / show; null when there were no shows: the rate is undefined, not zero

number
nullable
showWidget
Showwidget

showWidget / show; null when there were no shows: the rate is undefined, not zero

number
nullable
addToCart
Addtocart

addToCart / show; null when there were no shows: the rate is undefined, not zero

number
nullable
applyCoupon
Applycoupon

applyCoupon / show; null when there were no shows: the rate is undefined, not zero

number
nullable
copyToClipboard
Copytoclipboard

copyToClipboard / show; null when there were no shows: the rate is undefined, not zero

number
nullable
items
required
Items

Live widgets by shows, most first, or in the order of widget_ids. Deleted widgets and events without a widget are left out, so the sum may be below the site total.

Array<object>
WidgetStatsBreakdownItem
object
FieldDescription
id
required
Id

Widget id

integer
name
Name
string
nullable
total
required
WidgetMetrics

Event counts keyed by event type; every key is always present.

object
FieldDescription
show
required
Show
integer
submit
required
Submit
integer
openUrl
required
Openurl
integer
showWidget
required
Showwidget
integer
addToCart
required
Addtocart
integer
applyCoupon
required
Applycoupon
integer
copyToClipboard
required
Copytoclipboard
integer
rates
required
Rates

Each action counter of total divided by show, so the conversion rate is rates.submit; every key is always present, null when show is 0

object
FieldDescription
submit
Submit

submit / show; null when there were no shows: the rate is undefined, not zero

number
nullable
openUrl
Openurl

openUrl / show; null when there were no shows: the rate is undefined, not zero

number
nullable
showWidget
Showwidget

showWidget / show; null when there were no shows: the rate is undefined, not zero

number
nullable
addToCart
Addtocart

addToCart / show; null when there were no shows: the rate is undefined, not zero

number
nullable
applyCoupon
Applycoupon

applyCoupon / show; null when there were no shows: the rate is undefined, not zero

number
nullable
copyToClipboard
Copytoclipboard

copyToClipboard / show; null when there were no shows: the rate is undefined, not zero

number
nullable

Example · Generated

{
"period": {
"date_from": "2026-04-15",
"date_to": "2026-04-15"
},
"matched": 1,
"total": {
"show": 1,
"submit": 1,
"openUrl": 1,
"showWidget": 1,
"addToCart": 1,
"applyCoupon": 1,
"copyToClipboard": 1
},
"rates": {
"submit": 1,
"openUrl": 1,
"showWidget": 1,
"addToCart": 1,
"applyCoupon": 1,
"copyToClipboard": 1
},
"items": [
{
"id": 1,
"name": "example",
"total": {
"show": 1,
"submit": 1,
"openUrl": 1,
"showWidget": 1,
"addToCart": 1,
"applyCoupon": 1,
"copyToClipboard": 1
},
"rates": {
"submit": 1,
"openUrl": 1,
"showWidget": 1,
"addToCart": 1,
"applyCoupon": 1,
"copyToClipboard": 1
}
}
]
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Unsupported GSC-Version

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Missing or invalid API key or access token

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

WWW-Authenticate
string

Authentication scheme: Bearer

Access denied

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Not found

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Validation failed

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Rate limited

Media typeapplication/problem+json
Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds

Retry-After
integer

Seconds until the bucket refills

Media typeapplication/problem+json

temporarily_unavailable: the statistics store timed out or is overloaded; the heavy request is spent all the same

Problem

The documented shape of every error body on the versioned surface.

object
FieldDescription
type
required
Type
string
title
required
Title
string
status
required
Status
integer
detail
Detail
string
nullable
instance
required
Instance
string
reason
Reason
string
nullable
next
Next
string
nullable
request_id
required
Request Id
string
errors
Errors
Array<object>
nullable
ValidationIssue
object
FieldDescription
loc
required
Loc
Array
msg
required
Msg
string
type
required
Type
string
metadata
Metadata
object

Example · Generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"reason": "example",
"next": "example",
"request_id": "example",
"errors": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
],
"metadata": {}
}
FieldDescription
GSC-Version
string

API version the response was produced for

X-Request-Id
string

Request id, echoed from the request when valid

X-RateLimit-Limit
integer

Limit of the tightest bucket

X-RateLimit-Remaining
integer

Requests left in its window

X-RateLimit-Reset
integer

End of its window, epoch seconds