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 Authorization header.

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://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

FieldTypeRequiredDescription
widget_unique_idstringRequiredExisting widget unique_id.
activity_typestringRequiredview or click.
referrer_urlstringOptionalPage the widget was embedded on.
ip_addressstringOptionalClient IP (used in the daily dedup key).
device_typestringOptionaldesktop, 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

{
  "data": {
    "status": "success",
    "message": "Record saved successfully!"
  }
}

422 Unprocessable Entity · 422

{
  "message": "The widget unique id field is required.",
  "errors": {
    "widget_unique_id": [
      "The widget unique id field is required."
    ]
  }
}

Errors

StatusMeaning
401The bearer token is missing, expired or invalid
422Unprocessable Entity
500Unexpected 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"}'

Did this page help you?