First real project: pulling GA4 data with Python to track AI referrals
Learning Python through a real project and chose to build something useful: a script that pulls GA4 data and shows me which AI tools (ChatGPT, Perplexity, etc.) are sending traffic to my blog.
I got the GA4 API authentication working and cal pull basic session data, but struggling with the normalization step ; figuring out which sessions came from AI tools when the referrer isn't always clean. Been comparing my output to Zen Reports (a tool that does this automatically) to sanity-check my logic. If anyone's done similar GA4 API work in Python, would love a code review on my session classification logic.