Track widget activity
Overview
Record a view or click event for a widget, deduplicated per widget + activity type + IP + device per calendar day. Increments a running total_count when the same combination is seen again that day.
Prerequisites
- A bearer token in the
Authorizationheader.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/widget/activity
Authentication
-
Requires a bearer token in the
Authorization: Bearer <bearer-token>header. -
Bearer — any valid token (no role or ownership gate is applied).
Rate limit
- No rate limit.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
widget_unique_id | string | Required | Existing widget unique_id. |
activity_type | string | Required | view or click. |
referrer_url | string | Optional | Page the widget was embedded on. |
ip_address | string | Optional | Client IP (used in the daily dedup key). |
device_type | string | Optional | desktop, mobile or tablet. |
{
"widget_unique_id": "abc123",
"activity_type": "view",
"referrer_url": "https://example.com/",
"device_type": "desktop"
}How it works
- 200 with
{ "data": { "status": "success", "message": "Record saved successfully!" } }. - 422 validation (unknown widget / bad activity_type).
Response
200 OK · 200
200{
"data": {
"status": "success",
"message": "Record saved successfully!"
}
}422 Unprocessable Entity · 422
422{
"message": "The widget unique id field is required.",
"errors": {
"widget_unique_id": [
"The widget unique id field is required."
]
}
}Errors
| Status | Meaning |
|---|---|
401 | The bearer token is missing, expired or invalid |
422 | Unprocessable Entity |
500 | Unexpected server error |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/widget/activity" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"widget_unique_id": "abc123", "activity_type": "view", "referrer_url": "https://example.com/", "device_type": "desktop"}'Updated 10 days ago
Did this page help you?
