> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blink.store/llms.txt
> Use this file to discover all available pages before exploring further.

# Track an Event

> Tracks a custom event for analytics purposes. Requires the `x-store-id` header for identifying the store. Accepts an `eventName`, `eventData`, `url`, and `referrer`. Utilizes Umami for tracking and groups URLs under the store for Blink's dashboard.

**Use case:** This endpoint allows for tracking custom events for a store, useful in analyzing customer interactions, marketing effectiveness, and performance metrics.

**Request Body:**
- `eventName` (string, required): The name of the event.
- `eventData` (object, optional): Additional data related to the event.

**Responses:**
- **200:** Event tracked successfully.




## OpenAPI

````yaml post /events
openapi: 3.0.0
info:
  title: Webhooks & Events
  description: Comprehensive API documentation for Blink.
  version: 1.0.0
servers:
  - url: https://api.blink.store/v1
security:
  - storeIdHeader: []
paths:
  /events:
    post:
      tags:
        - Webhooks
      summary: Track an Event
      description: >
        Tracks a custom event for analytics purposes. Requires the `x-store-id`
        header for identifying the store. Accepts an `eventName`, `eventData`,
        `url`, and `referrer`. Utilizes Umami for tracking and groups URLs under
        the store for Blink's dashboard.


        **Use case:** This endpoint allows for tracking custom events for a
        store, useful in analyzing customer interactions, marketing
        effectiveness, and performance metrics.


        **Request Body:**

        - `eventName` (string, required): The name of the event.

        - `eventData` (object, optional): Additional data related to the event.


        **Responses:**

        - **200:** Event tracked successfully.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventTrackingRequest'
      responses:
        '200':
          description: Event tracked successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
components:
  schemas:
    EventTrackingRequest:
      type: object
      properties:
        eventName:
          type: string
          description: The name of the event to be tracked.
        eventData:
          type: object
          description: Additional data to be recorded with the event.
        url:
          type: string
          description: The URL associated with the event.
        referrer:
          type: string
          description: The referrer of the event.
      required:
        - eventName
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
  securitySchemes:
    storeIdHeader:
      type: apiKey
      in: header
      name: x-store-id

````