Hardal DB: Event Data Model for Server-side Analytics

Discover how Hardal simplifies the use of our server-to-server endpoint for deep product analytics by collecting first-party custom event data with a flexible structure. Get insights through server-side data and accelerate your product’s growth.

BD
Berkay Demirbas
CTO
Server-side Analytics
07.10.2024

Traditional client-side data collection methods can be limiting, often missing critical insights or getting blocked by browser restrictions.

Because client-side is hard!

wine cry for client side

This is where our Server-to-Server Endpoint comes in, offering a seamless way to send and store event data directly from your product to your database, enabling richer analytics.

Our server-to-server endpoint empowers you to gather, analyze, and visualize your product's performance through custom event data. This feature is ideal for businesses looking to go beyond basic analytics and into advanced product analytics.

How Does It Work?

Our server-to-server endpoint uses a flexible data model that allows you to send custom events with any properties. These events are stored securely in your database, and you can access this data through PSQL URLs or directly via our API. The data model is designed to handle complex and nested event properties, giving you complete freedom to track any kind of data you need.

Hardal Server Event Data Model

Here’s the data model used by our endpoint:

Field Type Description
id UUID A unique identifier for each event.
event_name String The name of the event (e.g., 'purchase', 'signup').
hardal_server_request_id String A unique identifier for the user or request in our system.
client_id String The client identifier associated with the event.
properties JSON A flexible field for any additional data sent as JSON, including nested structures.
created_at DateTime The timestamp when the event was created.

Why Is This Important for Product Analytics?

This data model allows you to customize your analytics and gain deeper insights into your users' behavior. Here are a few ways you can use the server-to-server endpoint for product analytics:

  1. Track Custom Events: Track any kind of event that’s important for your product, such as purchases, signups, button clicks, or even custom milestones. You decide what matters for your analytics.

  2. Capture Complex Data: With the flexible properties field, you can capture complex or nested data structures. For example, you can send information about the user's device, preferences, or actions all in one event.

  3. Unify Data Across Platforms: Server-to-server data collection allows you to unify data from different platforms (web, mobile, backend) in one central database. This is crucial for cross-platform analytics and gives you a complete picture of your product usage.

  4. Reliable Data Collection: Since data is sent directly from your server, you won’t have to worry about data loss due to ad blockers or browser restrictions, making it a more reliable method for tracking key events.

How to Set It Up

Setting up the server-to-server endpoint is simple. Here's a quick guide to get started:

  1. Send Event Data: Make a POST request to the endpoint URL with your event data. The event data should follow the structure defined above.

    Example payload:

    {
      "event_name": "purchase",
      "hardal_server_request_id": "d9214a7105a10ef04282595ee0d671ff9c2280a45c93fa1ccceec4a81f473cba",
      "client_id": "7f915be8-5afa-4678-a216-a8662c34a68e",
      "properties": {
        "product_id": "COMPUTER_SKU123",
        "price": 29.99,
        "currency": "USD",
        "nested_data": {
          "category": "electronics",
          "discount_code": "SALE2024"
        }
      },
      "created_at": "2024-10-06T12:34:56Z"
    }
    
  2. Access Data: You can access the stored event data via a PSQL URL that is provided in your dashboard. Simply connect your favorite analytics or BI tool to this database to start querying the data.

  3. Analyze and Visualize: Once your event data is in the database, you can run powerful queries to gain insights into user behavior, conversion rates, product performance, and more. Use this data to make informed decisions that drive product growth.

Our Server-to-Server Endpoint is designed to give you more control over your product analytics by allowing custom events, flexible data structures, and reliable server-side data collection. Whether you are building a SaaS product, an eCommerce platform, or any digital service, this feature enables you to understand your users better and take actions that lead to growth.

Get started today by logging into your dashboard and setting up your first server-to-server event!