Skip to content

Analytics (Depreciated)

We transitioned over to Google Analytics 4 and Google Tag Manager and stopped tracking this data.

Analytics Service File Structure

  • DirectorySNAPCASTER-BACKEND
    • Directoryservices
      • Directoryanalytics
        • Directorydependencies
          • mongo.py
          • s3.py
          • sqs.py
        • Directoryroutes
          • analytics.py
        • .gitignore
        • Dockerfile
        • main.py

GET /health

Depending on whether the user can connect to the MongoDB Analytics Collection. The user will recieve either:

  1. HTTPS 200 OK | message: Service is running, num_docs: [num_docs]
  2. HTTPS 500 Internal Server Error | "message": "Service is down", "error": [Exception e]

Health Object

PropertyTypeDetails
messageStringDetails about service status
num_docsStringNumber of documents in the analytics collection

GET /report

The report endpoint will return the card data analytics containing a dictionary of the document counts, and lists of the data quality, scraper tasks, and scraper status.

  1. HTTPS 200 OK
  2. HTTPS 500 Internal Server Error

Report Object

PropertyTypeDetails
document_countDictA dictionary of each database and their datasets
data_qualityListThe 7 most recent days analytics containing the uniqueness score, total documents, etc
scraper_tasksListInformation about the most recent executions of the four scraper tasks
scraper_statusListStatus of scrapers while they are running

GET /sqs-stats

The sqs-stats endpoint connects to the AWS S3 and SQS service used for updating Snapcasters CDN.

  1. HTTPS 200 OK | messages_available:[#], messages_in_flight:[#]

SQS-Stats Object

PropertyTypeDetails
messages_availableIntegerNumber of SQS messages available
messages_in_flightIntegerNumber of SQS messages in flight