Blog de Kev C

← Back to blog

Published on 2025-05-18 5:04 by Kevin Coyle

Analytics? Why Not

The project evolved from a deploy-ready full-stack app to an instrumented platform with backend analytics. Here’s a breakdown of the key improvements and why they matter.

Highlights

import os
from snowplow_tracker import Tracker, Emitter

emitter = Emitter(os.environ["SNOWPLOW_COLLECTOR"])
tracker = Tracker(emitter, namespace="backend", app_id="dude-scouts")

I first came across Snowplow when I was working as the Data Engineer/Data Scientist/MLE/Salesforce Dev at Alo Yoga. I was pushed to learn to use this when I mentioned that I wanted to build a data warehouse that contained click level data from the ecom site. I was told they didn’t have budget, which is all gucci. Restriction is the mother of all invention or whatever. Anywho, now I know how snowplow works and as someone who always loves the idea of a cool dashboard, I figured we could collect user analytics with Snowplow. Also, I could keep my chops a little sharper.

from app.core.tracking import tracker

@app.get("/")
async def root():
    tracker.track_struct_event("api", "root")
    return {"message": "Dude Scouts API", "environment": settings.environment}
from app.core.tracking import tracker

# inside create_post(...)
tracker.track_struct_event("community", "create_post", label=str(row["id"]))

Why this matters

What to configure after pulling

Some stuff I need to do, now that I’ve added in Snowplow

Summary

Written by Kevin Coyle

← Back to blog