Analytics & Reports

Analytics & Reporting

Track user behavior and generate reports with the analytics API.

POST/analytics/log

Logs an analytics event and applies legacy-compatible visitor, visit, page, click, and email tracking behavior.

Legacy Compatibility Summary

  • Accepts legacy browser tracking properties used by classic /includes/hit.asp.

  • Supports visitor/session/customer/campaign continuity using request payload plus cookie fallback.

  • Creates and updates visitor and visit records, including page and visit tallies.

  • Handles email shot open/click tracking and click inserts.

  • Normalizes referrer domains and extracts search keywords for reporting dimensions.

Request Body

{
  "event": {
    "vi": 1234,
    "vt": 5678,
    "ci": 9012,
    "appID": 42,
    "ct": "aurora_customers",
    "ca": 100,
    "shot": "encrypted-or-numeric-shot-id",
    "e": 0,
    "title": "Product Detail",
    "t": "aurora_products",
    "i": 321,
    "url": "https://example.com/products/321",
    "ref": "https://google.com/search?q=wireless+headphones",
    "click": false,
    "co": "true",
    "pl": "Windows",
    "bn": "Chrome",
    "bv": "122.0",
    "av": "web-1.0.0",
    "w": 1920,
    "h": 1080,
    "c": 24,
    "aw": 1848,
    "ah": 920,
    "oid": 778899
  },
  "site-id": 42
}

Event Properties

  • vi number

    Visitor ID (cookie fallback: InfomaximVisitor).

  • vt number

    Visit ID (cookie fallback: InfomaximVisit).

  • ci number

    Customer ID (cookie fallback: AuroraCustomerID).

  • appID number

    Site/application ID (legacy ShopID).

  • ct string

    Customer table name used for visitor-customer linking.

  • ca number

    Campaign ID; if omitted, campaign cookie value is used when available.

  • shot string|number

    Email shot ID (encrypted or numeric).

  • e number

    Email mode: 1 click, 2 view/open, 0 normal page flow.

  • t string

    Table/type identifier.

  • i number

    Tracked record ID.

  • title string

    Page title.

  • url string

    Current page or click URL.

  • ref string

    Referrer URL (base domain + search keyword parsing).

  • click boolean|number

    When true/1, click mode suppresses page-hit insert.

  • co string|boolean

    Cookie enabled flag.

  • pl string

    Platform/OS.

  • bn string

    Browser name.

  • bv string

    Browser version.

  • av string

    Client application version.

  • w/h/c/aw/ah number

    Display and browser viewport properties.

  • oid number

    Order ID for attribution updates.

Business Logic Notes

  • User-agents containing bot or Java/ are ignored.

  • New visitors are persisted and receive a long-lived Infomaxim cookie; new visits receive short-lived InfomaximVisit cookie.

  • Email click mode updates shot click and open counters and records click details.

  • Email view mode updates shot open counters.

  • Referrer normalization maps blank/self/internal to Direct, and maps t.co to twitter.com.

  • Search keywords are extracted from q=, query=, or p= when present in referrer URL.

Success Response (200 OK)

{
  "status": "Success",
  "message": "Event logged successfully",
  "visitorID": 1234,
  "visitID": 5678,
  "customerID": 9012,
  "redirectURL": "",
  "ignored": false,
  "reason": "",
  "hasInboundCookies": true
}

Angular Service Example

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';

interface AnalyticsEvent {
  vi?: number;
  vt?: number;
  ci?: number;
  appID: number;
  ct?: string;
  ca?: number;
  shot?: string | number;
  e?: number;
  title?: string;
  t?: string;
  i?: number;
  url: string;
  ref?: string;
  click?: boolean | number;
  co?: string | boolean;
  pl?: string;
  bn?: string;
  bv?: string;
  av?: string;
  w?: number;
  h?: number;
  c?: number;
  aw?: number;
  ah?: number;
  oid?: number;
}

@Injectable({ providedIn: 'root' })
export class AnalyticsService {
  private readonly endpoint = '/api/v2/analytics/log';

  constructor(private http: HttpClient) {}

  logPageView(appID: number, table: string, recordID: number, title: string, campaignID = 0): Observable {
    return this.http.post(this.endpoint, {
      event: {
        appID,
        t: table,
        i: recordID,
        title,
        url: window.location.href,
        ref: document.referrer || '',
        co: navigator.cookieEnabled,
        pl: navigator.platform,
        bn: this.browserName(),
        bv: this.browserVersion(),
        w: window.screen.width,
        h: window.screen.height,
        c: window.screen.colorDepth,
        aw: window.innerWidth,
        ah: window.innerHeight,
        ca: campaignID,
        click: false
      }
    });
  }

  logEmailClick(appID: number, shot: string | number, url: string): Observable {
    return this.http.post(this.endpoint, {
      event: {
        appID,
        e: 1,
        shot,
        t: 'mailto',
        url,
        click: 1
      }
    });
  }

  private browserName(): string {
    const ua = navigator.userAgent;
    if (ua.includes('Chrome')) return 'Chrome';
    if (ua.includes('Safari') && !ua.includes('Chrome')) return 'Safari';
    if (ua.includes('Firefox')) return 'Firefox';
    if (ua.includes('Edg')) return 'Edge';
    return 'Unknown';
  }

  private browserVersion(): string {
    const ua = navigator.userAgent;
    const match = ua.match(/(Chrome|Firefox|Version|Edg)\/([0-9.]+)/);
    return match?.[2] || '0';
  }
}

GET/report/eventBookings/:id

Generates a report of event bookings.

URL Parameters

  • id number required

    Event ID for the booking report.

Query Parameters

  • startDate string

    Start date for the report (ISO 8601 format).

  • endDate string

    End date for the report (ISO 8601 format).

Success Response (200 OK)

{
  "status": "Success",
  "data": {
    "eventID": 1,
    "eventName": "Annual Conference 2024",
    "totalBookings": 450,
    "totalRevenue": 45000.00,
    "bookings": [
      {
        "bookingID": 1001,
        "customerName": "John Doe",
        "ticketType": "VIP",
        "amount": 150.00,
        "bookingDate": "2024-01-01T10:00:00Z"
      }
    ]
  }
}