JIMMY DAHLQVIST | 2024-08-24 Serverless website analytics with Lambda@Edge
Serverless website analytics with Lambda@Edge Jimmy Dahlqvist AWS Ambassador Community Builder AWS-UG Scania, Sweden. 2024-08-24
JIMMY DAHLQVIST Head of AWS @ Sigma Technology Cloud Founder of serverless- handbook.com AWS Ambassador | AWS Community Builder | User Group Leader § Hello, I'm
Todays agenda Episode I: The Problem Awakens Episode II: Birth of a Solution Episode III: Revenge of the Gotchas Episode IV: A New Refined Solution Episode V: Summary
Episode I: The Problem Awakens
Website statistics Google Analytics Been my tracker for years Universal Analytics deprecated Way to advanced Open Source alternatives Plausible and Matomo Fathom Analytics Not free
I just want Easy way to understand my readers! How hard can it be? Could I track in the backend?
Episode II: Birth of a Solution
Thoughts No client side tracking Page (post), Time, and Country Can I integrate into my CloudFront distribution?
Decoupled and event-driven Event-driven solution Decouple Ingestion Storage Analytics
CloudFront Integration points
Lambda@Edge vs CloudFront Functions Lambda@Edge All integration points Network access Up to 5 or 30 second duration CloudFront Functions Viewer Request / Response No network access Sub millisecon duration
Ingestion
Data-store
Analytics
Episode III: Revenge of the Gotchas
Three problems Solution failed to deploy, cryptic error message There was missing data Page felt sluggish
Gotcha Lambda@Edge and Functions won’t combine Lambda@Edge -> EventBridge high latency Glue and new lines CloudFront headers in cache policy
Episode IV: A New Refined Solution
Needed to solve High Latency Time & Date Viewer type
I know what blog post is accessed at what time I can visualize where in the world my users are locates I can create dashboards that show the information I need