{"id":3763,"date":"2024-09-05T16:18:08","date_gmt":"2024-09-05T21:18:08","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=3763"},"modified":"2024-09-05T16:18:09","modified_gmt":"2024-09-05T21:18:09","slug":"third-party-scripts","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/third-party-scripts\/","title":{"rendered":"Third Party Scripts"},"content":{"rendered":"\n<p><a href=\"https:\/\/almanac.httparchive.org\/en\/2022\/third-parties#prevalence\">Almost every site<\/a> has at least one third-party script on it, and the <a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1YqoRRsyiNsrEabVLu2nRU98JIG_0zLLuoQhC2nX8xbM\/edit?gid=1428106498#gid=1428106498\">average is 5<\/a>. I&#8217;ve taken that from the blog post <a href=\"https:\/\/nuxt.com\/blog\/nuxt-scripts?ck_subscriber_id=2246502080\">Introducing Nuxt Scripts<\/a> from Harlan Wilton. While third-party scripts are a performance and security drain, they are, as Harlan puts it &#8220;fundamentally useful and aren&#8217;t going anywhere soon.&#8221; <\/p>\n\n\n\n<p>Typically, you just chuck a third-party script in the HTML somewhere with a <code>&lt;script><\/code> tag that is high enough up that any usage of it comes <em>after. <\/em>But these days, with JavaScript frameworks abound, loading and using them is far more complicated. I applaud Nuxt for taking this head on and providing sensible helpers for them. Loading triggers and callbacks, types, bundling, etc. <\/p>\n\n\n\n<p>Looks like it&#8217;s on the roadmap, but getting <a href=\"https:\/\/partytown.builder.io\/\">Partytown<\/a> in there to gets the scripts off the main thread would be very good.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Almost every site has at least one third-party script on it, and the average is 5. I&#8217;ve taken that from the blog post Introducing Nuxt Scripts from Harlan Wilton. While third-party scripts are a performance and security drain, they are, as Harlan puts it &#8220;fundamentally useful and aren&#8217;t going anywhere soon.&#8221; Typically, you just chuck [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3764,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[3,236,70,237],"class_list":["post-3763","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-javascript","tag-nuxt","tag-performance","tag-third-party-scripts"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/09\/banner.webp?fit=1200%2C630&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/3763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=3763"}],"version-history":[{"count":1,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/3763\/revisions"}],"predecessor-version":[{"id":3765,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/3763\/revisions\/3765"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/3764"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=3763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=3763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=3763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}