Skip to content

InsightCore Analytics API

The InsightCore Analytics API enables you to collect, analyze, and report on user behavior across your web properties. It provides event ingestion, real-time visitor tracking, historical reporting, and conversion funnel analysis.

Overview

InsightCore provides a lightweight analytics pipeline for web and ecommerce applications:

  • Event Collection - Ingest page views, interactions, and ecommerce events via a simple POST endpoint
  • JavaScript Tag - Drop-in analytics tag with automatic page view, scroll, and click tracking
  • Real-Time Analytics - Active visitor counts, live event streams, and page views per minute
  • Historical Reports - Page performance, traffic sources, event breakdowns, and ecommerce metrics
  • Conversion Funnels - Define multi-step funnels and analyze drop-off rates

Data Flow

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   Your Website  │     │   InsightCore   │     │   Your Backend  │
└────────┬────────┘     └────────┬────────┘     └────────┬────────┘
         │                       │                       │
         │  <script> tag loads   │                       │
         │──────────────────────>│                       │
         │  rsp-analytics.js     │                       │
         │<──────────────────────│                       │
         │                       │                       │
         │  POST /v1/collect     │                       │
         │  (page views, clicks, │                       │
         │   ecommerce events)   │                       │
         │──────────────────────>│                       │
         │                       │                       │
         │                       │  GET /v1/analytics/*  │
         │                       │<──────────────────────│
         │                       │  Reports, realtime,   │
         │                       │  funnels              │
         │                       │──────────────────────>│

Base URLs

EnvironmentURL
Staginghttps://api-staging.insightcore.retailsuccessplatform.com/api/v1
Productionhttps://api.insightcore.retailsuccessplatform.com/api/v1

Quick Start

1. Register Your Site

Create a site configuration to get your organization ID and allowed domains:

bash
curl -X POST https://api.insightcore.retailsuccessplatform.com/api/v1/settings \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "site_name": "My Store",
    "allowed_domains": ["mystore.com", "www.mystore.com"]
  }'

2. Install the JavaScript Tag

Add the analytics tag to your site. Replace YOUR_ORG_ID with your organization's hashkey:

html
<script>
  var rspaq = rspaq || [];
  rspaq.push(['init', 'YOUR_ORG_ID']);
</script>
<script async src="https://api.insightcore.retailsuccessplatform.com/api/v1/tag/rsp-analytics.js"></script>

The tag automatically tracks page views, scroll depth, clicks, and form submissions.

3. Query Your Analytics

Fetch an overview report for the last 7 days:

bash
curl "https://api.insightcore.retailsuccessplatform.com/api/v1/analytics/reports/overview?from=2026-03-19&to=2026-03-26" \
  -H "Authorization: Bearer ${TOKEN}"
json
{
  "data": {
    "total_visitors": 12450,
    "total_page_views": 38920,
    "bounce_rate": 42.3,
    "avg_session_duration_seconds": 185
  }
}

Authentication

EndpointAuthRate Limit
Event CollectionNone (public)60/min per IP
JavaScript TagNone (public)Cached (ETag)
Site SettingsOAuth Bearer100/min
FunnelsOAuth Bearer100/min
Real-Time AnalyticsOAuth Bearer100/min
ReportsOAuth Bearer100/min

The collection and tag endpoints are public — they accept events from browsers without authentication. All management and reporting endpoints require an OAuth 2.0 Bearer token from the Identity API.

Tracked Event Types

Event TypeSourceDescription
page_viewAutoPage loads and SPA navigations
scroll_depthAutoMaximum scroll percentage reached
clickAutoLink and button clicks
form_submitAutoForm submissions
product_viewManualProduct detail page views
add_to_cartManualItems added to cart
checkoutManualCheckout initiated
purchaseManualOrder completed
searchManualSearch queries

Next Steps


Changelog
DateChange
2026-03-26Initial publication.

ShopHero CommerceCore Platform