Skip to content
ReadyZone Docs
API Reference

Portal analytics

Record a captive portal usage event.

POST /api/mikrotik/analytics/events

Access: Public

Portal use case

The portal sends view, payment, free-offer, and support events to feed zone analytics.

Request body

{
  "eventType": "portal_view",
  "companyReference": "readyzone-center-12345",
  "macAddress": "AA:BB:CC:DD:EE:FF",
  "portalTemplate": "model-4-template-1",
  "page": "login",
  "url": "http://192.168.88.1/login",
  "metadata": {}
}

Request attributes

AttributeTypeRequiredDescription
eventTypestringYesEvent type accepted by the API. See the list below.
companyReferencestringYesPublic zone reference, maximum 64 characters.
macAddressstringYesMAC address observed by the portal, maximum 64 characters.
portalTemplatestringNoTemplate identifier, maximum 64 characters.
pagestringNoOrigin page or screen, maximum 64 characters.
urlstringNoPage URL, maximum 512 characters.
ipAddressstringNoClient IP address, maximum 64 characters.
routerIdentitystringNoMikroTik router identity, maximum 128 characters.
hotspotServerNamestringNoHotspot server name, maximum 128 characters.
metadataobjectNoAdditional JSON data. Do not include secrets, passwords, or OTPs.

eventType values

ValueMeaning
portal_viewInitial portal display.
buy_plan_clickClick on the plan purchase action.
news_clickClick on an announcement.
services_clickOpen or click on the services section.
login_clickPortal login attempt.
recover_credentials_clickCredential recovery request.
powered_by_clickClick on the ReadyZone link.
logout_clickPortal logout.
plan_list_viewPlan list displayed.
plan_detail_viewPlan details displayed.
checkout_startedCheckout opened or payment started.
payment_method_selectedPayment method selected.
payment_startedTransaction initialized.
payment_successPayment successfully confirmed.
payment_failedPayment failed.
otp_requestedOTP delivery requested.
otp_verifiedOTP verified.
free_offer_activatedFree offer activated.
support_contact_email_clickSupport email button clicked.
support_contact_phone_clickSupport phone button clicked.
support_contact_openSupport dialog opened.

Collection rules

  • The browser sends Content-Type: application/json and Accept: application/json.
  • Collection is public and must not be used to transmit credentials or payment data.
  • metadata must contain only data useful for analytics and stay within the API size limits.
  • The portal may skip an event when the zone reference or MAC address is unavailable.

Status codes

  • 201 Created
  • 400 Bad Request (invalid payload)
  • 403 Forbidden (zone not authorized)

On this page