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:
HTTPS 200 OK | message: Service is running, num_docs: [num_docs]
HTTPS 500 Internal Server Error | "message": "Service is down", "error": [Exception e]
Health Object
Property | Type | Details |
---|---|---|
message | String | Details about service status |
num_docs | String | Number 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.
HTTPS 200 OK
HTTPS 500 Internal Server Error
Report Object
Property | Type | Details |
---|---|---|
document_count | Dict | A dictionary of each database and their datasets |
data_quality | List | The 7 most recent days analytics containing the uniqueness score, total documents, etc |
scraper_tasks | List | Information about the most recent executions of the four scraper tasks |
scraper_status | List | Status 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.
HTTPS 200 OK | messages_available:[#], messages_in_flight:[#]
SQS-Stats Object
Property | Type | Details |
---|---|---|
messages_available | Integer | Number of SQS messages available |
messages_in_flight | Integer | Number of SQS messages in flight |