Aside from the creative engineering at work the site needed to convert, with a creative campaign that utilized Meta (Facebook and Instagram), Linkedin, and Google Ads with HubSpot as the CRM there was quite a bit of tracking that had to be hooked up. In order to make maintenance easier I utilized Google Tag Manager as the source of truth (it also played nicely with Facebook’s Conversion API). Custom Google Analytics 4 events were created to have more control over understanding which parts of the site were performing or underperforming.
To help combat performance issues that sites often have when many third-party tracking scripts are added I implemented partytown, a lazy-loaded library to help relocate resource-intensive scripts into a web worker, and off of the main thread. This speeds up the site by dedicating the main thread to the actual code, and offloading third-party scripts to a web worker.