Overview

Hardal Analytics API provides a simple REST API for tracking events and identifying users across your websites and mobile applications.

Hardal Analytics is cookieless, first-party and privacy-friendly, compliant with GDPR and KVKK regulations.

API Endpoint

POST https://signal.<yourcustomdomain>.com/push/hardal

Required Header:

  • Content-Type: application/json

Signal ID: Your website or app ID from the Hardal dashboard (required for all requests).

API Structure

Every request follows this structure:

{
  "type": "...",
  "payload": {
    "website": "...",
    "name": "...",
    // other fields
    "data": {
      // custom parameters
    }
  }
}

Structure Explanation

  • type: Defines the request type. Use "event" for tracking events or "identify" for user identification.
  • payload: Contains all the event information including required fields and optional custom data.
  • data: Optional object inside payload for your custom parameters. Only include if you have custom data to send.

Send Event Data

Basic Event

Send an event with just the event name and required parameters.

Event Names: Use consistent naming conventions like page_view, button_click, form_submit.

{
  "type": "event",
  "payload": {
    "website": "your-signal-id",
    "name": "page_view",
    "url": "https://example.com/products",
    "title": "Products Page",
    "device_type": "mobile",
    "language": "en-US",
    "platform": "app"
  }
}

Event with Custom Parameters

Add custom data to your events using the data object.

Custom Data: Place any custom parameters inside the data object.

{
  "type": "event",
  "payload": {
    "website": "your-signal-id",
    "name": "purchase",
    "url": "https://example.com/checkout/success",
    "title": "Checkout Success",
    "device_type": "desktop",
    "language": "en-US",
    "platform": "web",
    "data": {
      "transaction_id": "TX123456",
      "currency": "USD",
      "value": 99.95,
      "items_count": 3,
      "customer_type": "returning"
    }
  }
}

Identify Users

Link user identity to their sessions and activity.

{
  "type": "identify",
  "payload": {
    "website": "your-signal-id",
    "name": "identify",
    "url": "https://example.com/profile",
    "title": "User Profile",
    "device_type": "mobile",
    "language": "en-US",
    "platform": "app",
    "data": {
      "email": "user@example.com",
      "name": "John Doe",
      "user_id": "12345",
      "plan": "premium",
      "signup_date": "2023-01-15"
    }
  }
}

For ATT (App Tracking Transparency) compliance, you can hash or redact PII data in the Hardal UI.

Implementation Guide

Required Fields

  • website: Your Signal ID. You can use also for app measurement.
  • name: Event name. For example, “purchase” (use “identify” for identify calls)
  • url: Current page or screen URL
  • title: Page or screen title
  • device_type: “desktop”, “mobile”, or “tablet”
  • platform: “web”, “app”, or “server”

Response Codes

  • 200: Success
  • 400: Invalid request
  • 401: Invalid Signal ID