I built a simple first-party tracking system for my ads @aarondfrancis
I built a simple first-party tracking system for my ads  @aarondfrancis
Uploaded July 2025 | Updated September 2026, 6 hours ago
I'm running ads for the first time and needed a way to track if LinkedIn and Reddit are actually driving sales without relying on invasive third-party platforms. In this video, I walk through how I built a simple, privacy-conscious tracking system using cookies and Laravel middleware.

Check out my courses. Use the code YOUTUBE to get 20% off:
masteringpostgres.com
highperformancesqlite.com
screencasting.com

Follow me:
Twitter: twitter.com/aarondfrancis
LinkedIn: linkedin.com/in/aarondfrancis
Website: aaronfrancis.com - find articles, podcasts, courses, and more.

Chapters:
00:00 - Running ads for our courses
00:18 - Why I need first-party tracking
00:42 - Using UTM parameters to track sources
01:18 - Strategy: store UTM params on login
01:52 - Using cookies for anonymous visitors
02:35 - Logging in triggers cookie check
03:02 - Writing UTM data to the user record
03:40 - Building it as Laravel middleware
04:01 - Capturing UTM params from requests
04:48 - Fallback to cookies if no params
05:06 - Logic for logged-in vs anonymous users
05:55 - Storing UTM data in a cookie for one year
06:31 - Reading and decoding the cookie
07:22 - Storing UTM data in JSON column
08:03 - Deleting the cookie after writing to user
08:55 - Final logic review of the middleware
09:49 - Benefits of simple, privacy-first tracking
10:05 - Tracking ROI from LinkedIn and Reddit ads
10:16 - Final thoughts and ad help request
I built a simple first-party tracking system for my adsMake your site faster with this one techniqueThe Music Makers Podcast - 024 - You Can Be Busy Or Remarkable, But Not BothLaravel vs ReactPostgres on bare metal with the CEO of PrismaRead the docs (dont skim them)Laravel + Cloudflare D1 speedrunCreating a Postgres platform with Monica & Tudor from Xata.ioThe Music Makers Podcast - 006 - Create Time For What Is NecessaryWelcome to Token TownNew Laravel starter kit (with built-in billing)Laravels atomic locks
Aaron Francis |

I built a simple first-party tracking system for my ads

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER