Skip to content

Sources & Events

Sources

A source is any system that sends event data to Adwize. Currently supported sources:

Source Method Setup
Google Tag Manager Native OAuth integration Connect GTM guide
REST API POST /api/v1/events Custom API Integration

Additional sources (Segment, Amplitude, Tealium) are on the roadmap.

Events

An event represents a single data-layer action captured from a source. Every event has:

Field Type Description
source string Where the event came from (e.g. gtm, api)
event_type string The type of action (e.g. page_view, purchase, error)
data object Arbitrary payload — the fields you want to monitor
timestamp datetime When Adwize received the event

Example Event Payload

{
  "source": "gtm",
  "event_type": "purchase",
  "data": {
    "transaction_id": "TXN-12345",
    "value": 99.99,
    "currency": "USD",
    "items": [
      { "id": "SKU-001", "name": "Widget", "quantity": 1 }
    ]
  }
}

How Events Flow

sequenceDiagram
    participant S as Data Source
    participant A as Adwize API
    participant DB as Event Store
    participant R as Rule Engine

    S->>A: POST /api/v1/events (batch)
    A->>A: Validate domain & schema
    A->>DB: Store events
    Note over R,DB: Every 15 minutes
    R->>DB: Query recent events
    R->>R: Evaluate rules
    R->>DB: Create alerts (if triggered)

Events are ingested in batches, validated against your tenant's allowed domains, and stored. The rule engine evaluates rules on a regular cycle and creates alerts when conditions are met.

Domain Validation

Each tenant can configure allowed domains in Settings. When events arrive via the API, Adwize checks that the request origin matches one of the allowed domains. Events from unauthorized domains are rejected with 403 Forbidden.