Serverless website analytics with Lambda@Edge

JimmyDahlqvist 23 views 27 slides Apr 18, 2024
Slide 1
Slide 1 of 27
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27

About This Presentation

Serverless website analytics with Lambda@Edge


Slide Content

JIMMY DAHLQVIST | 2024-04-17 Serverless website analytics with Lambda@Edge

JIMMY DAHLQVIST Serverless enthusiast AWS Ambassador | AWS Community Builder | User Group Leader Founder of serverless- handbook.com Head of AWS @ Sigma Technology Cloud § 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: The Live Demo Strikes Back

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, Time, and Country Can I use CloudFront?

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 You can’t combine CloudFront Functions and Lambda@Edge

Decoupled and event-driven Event-driven solution Decouple Ingestion Storage Analytics

Ingestion

Data-store

Analytics

Episode III: Revenge of the Gotchas

Three problems Solution failed to deploy, cryptic error message There was missing data in Athena 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

A new hope

Episode V: The Live Demo Strikes Back

Serverless Handbook https://serverless- handbook.com /serverless-web-statistics

@ jimmydahlqvist dahlqvistjimmy https://serverless- handbook.com https:// jimmydqv.com THANK YOU