Skip to main content
GET
/
api
/
analytics
/
:eventId
curl -X GET https://api.gatepass.io/api/analytics/clx1234567890 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "totalRevenue": 125500.00,
  "ticketsSold": 1247,
  "totalTickets": 1500,
  "salesByDay": [
    {
      "date": "2024-05-01",
      "sales": 45
    },
    {
      "date": "2024-05-02",
      "sales": 78
    },
    {
      "date": "2024-05-03",
      "sales": 120
    },
    {
      "date": "2024-05-04",
      "sales": 156
    }
  ],
  "salesByTier": [
    {
      "name": "VIP",
      "sold": 98,
      "total": 100
    },
    {
      "name": "Premium",
      "sold": 234,
      "total": 300
    },
    {
      "name": "General",
      "sold": 915,
      "total": 1100
    }
  ],
  "attendance": {
    "checkIns": 1089,
    "noShows": 158,
    "checkInRate": 87.3,
    "hourlyBreakdown": [
      {
        "hour": "10:00",
        "checkIns": 45
      },
      {
        "hour": "11:00",
        "checkIns": 123
      },
      {
        "hour": "12:00",
        "checkIns": 234
      },
      {
        "hour": "13:00",
        "checkIns": 189
      },
      {
        "hour": "14:00",
        "checkIns": 267
      },
      {
        "hour": "15:00",
        "checkIns": 156
      },
      {
        "hour": "16:00",
        "checkIns": 75
      }
    ],
    "peakHours": [
      {
        "hour": "14:00",
        "count": 267
      },
      {
        "hour": "12:00",
        "count": 234
      },
      {
        "hour": "13:00",
        "count": 189
      },
      {
        "hour": "15:00",
        "count": 156
      }
    ]
  },
  "geography": {
    "cities": [
      {
        "city": "Lagos",
        "count": 567,
        "percentage": 45.5
      },
      {
        "city": "Abuja",
        "count": 234,
        "percentage": 18.8
      },
      {
        "city": "Port Harcourt",
        "count": 156,
        "percentage": 12.5
      },
      {
        "city": "Ibadan",
        "count": 123,
        "percentage": 9.9
      },
      {
        "city": "Kano",
        "count": 89,
        "percentage": 7.1
      }
    ],
    "countries": [
      {
        "country": "Nigeria",
        "count": 1098,
        "percentage": 88.0
      },
      {
        "country": "Ghana",
        "count": 78,
        "percentage": 6.3
      },
      {
        "country": "Kenya",
        "count": 45,
        "percentage": 3.6
      },
      {
        "country": "South Africa",
        "count": 26,
        "percentage": 2.1
      }
    ]
  }
}
Retrieve detailed analytics for an event, including sales data, attendance metrics, geographic distribution, and time-based patterns. Available to event organizers only.

Authentication

Authorization
string
required
Bearer token for authentication (organizer role required)

Path Parameters

eventId
string
required
The unique identifier of the event

Response

totalRevenue
number
Total revenue from ticket sales
ticketsSold
number
Total number of tickets sold
totalTickets
number
Total event capacity
salesByDay
array
Daily sales breakdown
salesByTier
array
Ticket sales by tier
attendance
object
Attendance and check-in metrics
geography
object
Geographic distribution of ticket buyers
curl -X GET https://api.gatepass.io/api/analytics/clx1234567890 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "totalRevenue": 125500.00,
  "ticketsSold": 1247,
  "totalTickets": 1500,
  "salesByDay": [
    {
      "date": "2024-05-01",
      "sales": 45
    },
    {
      "date": "2024-05-02",
      "sales": 78
    },
    {
      "date": "2024-05-03",
      "sales": 120
    },
    {
      "date": "2024-05-04",
      "sales": 156
    }
  ],
  "salesByTier": [
    {
      "name": "VIP",
      "sold": 98,
      "total": 100
    },
    {
      "name": "Premium",
      "sold": 234,
      "total": 300
    },
    {
      "name": "General",
      "sold": 915,
      "total": 1100
    }
  ],
  "attendance": {
    "checkIns": 1089,
    "noShows": 158,
    "checkInRate": 87.3,
    "hourlyBreakdown": [
      {
        "hour": "10:00",
        "checkIns": 45
      },
      {
        "hour": "11:00",
        "checkIns": 123
      },
      {
        "hour": "12:00",
        "checkIns": 234
      },
      {
        "hour": "13:00",
        "checkIns": 189
      },
      {
        "hour": "14:00",
        "checkIns": 267
      },
      {
        "hour": "15:00",
        "checkIns": 156
      },
      {
        "hour": "16:00",
        "checkIns": 75
      }
    ],
    "peakHours": [
      {
        "hour": "14:00",
        "count": 267
      },
      {
        "hour": "12:00",
        "count": 234
      },
      {
        "hour": "13:00",
        "count": 189
      },
      {
        "hour": "15:00",
        "count": 156
      }
    ]
  },
  "geography": {
    "cities": [
      {
        "city": "Lagos",
        "count": 567,
        "percentage": 45.5
      },
      {
        "city": "Abuja",
        "count": 234,
        "percentage": 18.8
      },
      {
        "city": "Port Harcourt",
        "count": 156,
        "percentage": 12.5
      },
      {
        "city": "Ibadan",
        "count": 123,
        "percentage": 9.9
      },
      {
        "city": "Kano",
        "count": 89,
        "percentage": 7.1
      }
    ],
    "countries": [
      {
        "country": "Nigeria",
        "count": 1098,
        "percentage": 88.0
      },
      {
        "country": "Ghana",
        "count": 78,
        "percentage": 6.3
      },
      {
        "country": "Kenya",
        "count": 45,
        "percentage": 3.6
      },
      {
        "country": "South Africa",
        "count": 26,
        "percentage": 2.1
      }
    ]
  }
}

Access Control

Only the event organizer (creator) can access analytics for their events. Attempting to view analytics for events created by other users will result in a 403 Forbidden error.

Use Cases

Sales Performance

Track daily sales trends to identify:
  • Peak sales periods
  • Impact of marketing campaigns
  • Last-minute ticket purchases
  • Tier popularity

Attendance Optimization

Use attendance data to:
  • Plan staff allocation during peak hours
  • Identify optimal check-in start times
  • Reduce wait times at entry
  • Predict no-show rates

Geographic Insights

Understand your audience to:
  • Target marketing in high-performing regions
  • Plan future event locations
  • Arrange transportation and accommodations
  • Tailor content to regional preferences
Analytics are updated in real-time as tickets are sold and attendees check in. Refresh the data during your event to monitor live attendance.

EventAnalytics Model

Analytics data is also stored in the EventAnalytics table with daily snapshots:
  • ticketsSold: Cumulative tickets sold
  • revenue: Total revenue
  • uniqueBuyers: Number of unique customers
  • checkIns: Total check-ins
  • checkInRate: Attendance percentage
  • noShows: Tickets purchased but not used
  • topCountries: JSON array of country data
  • topCities: JSON array of city data
  • hourlyBreakdown: JSON array of time-based patterns

Chart-Ready Data

All response arrays are formatted for direct use with charting libraries:
// Line chart: Sales over time
const salesChart = {
  labels: analytics.salesByDay.map(d => d.date),
  data: analytics.salesByDay.map(d => d.sales)
};

// Bar chart: Check-ins by hour
const attendanceChart = {
  labels: analytics.attendance.hourlyBreakdown.map(h => h.hour),
  data: analytics.attendance.hourlyBreakdown.map(h => h.checkIns)
};

// Pie chart: Sales by tier
const tierChart = {
  labels: analytics.salesByTier.map(t => t.name),
  data: analytics.salesByTier.map(t => t.sold)
};

Build docs developers (and LLMs) love