Get started with Open Analytics documentation

1. Introduction

Open Analytics is a website tracking tool for monitoring page views, unique visits, and custom events.

  • Track page views and visits
  • Log custom events with structured data
  • Monitor user activity with event tracking and analytics reports

Follow the steps below to get started quickly with Open Analytics.

2. Getting Started

Installation

Add the Open Analytics script to your site to start tracking page views.

For JS/React application:

inside - index.html head tag

<script defer data-url="LOGIN_INTO_DASHBOARD_TO_SEE" src="LOGIN_INTO_DASHBOARD_TO_SEE"></script>

For NextJS app router:

inside - before closing body tag at app/layout.[jsx,tsx]

import Script from 'next/script'

<Script defer data-url="LOGIN_INTO_DASHBOARD_TO_SEE" src="LOGIN_INTO_DASHBOARD_TO_SEE" strategy="afterInteractive" />

For NextJS pages router:

inside - before closing body tag at pages/_app.js

import Script from 'next/script'

<Script defer data-url="LOGIN_INTO_DASHBOARD_TO_SEE" src="LOGIN_INTO_DASHBOARD_TO_SEE" strategy="afterInteractive" />

3. Custom Event Tracking

Event Structure

Configure the API endpoint to receive analytics data specific to your domain. Track custom events with parameters like event type and api key.

Event API Endpoints

Use the following endpoint to record events:

POST /event/custom
Authorization: Bearer Loading...

Body:
{
  "event": "button_click", // Event type
  "domain": "example.com", // Website domain without protocol
  "description": "User clicked the button", // Event description
}

4. API Reference

Authentication

Use your API key in request headers for authentication.

Endpoints

List of API endpoints, their parameters, and responses:

GET /api/views
Authorization: Bearer Loading...

Error Codes

Common errors include invalid API keys, rate limit exceeded, etc.