---
title: "Load Third-Party Scripts in Nuxt · Nuxt Scripts"
description: "Better performance, privacy, security and DX for third-party scripts."
canonical_url: "https://scripts.nuxt.com/"
meta:
  "og:description": "Better performance, privacy, security and DX for third-party scripts."
  "og:image": "https://scripts.nuxt.com/_og/s/o_6641adfefe6df549.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Load Third-Party Scripts in Nuxt · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/s/o_6641adfefe6df549.png"
---

> Index of every page on this site: [llms.txt](https://scripts.nuxt.com/llms.txt)

[**v1 stable is here **](https://scripts.nuxt.com/docs/releases/v1)

# **Load Third-Party Scripts**<br>** **with Nuxt Scripts

Load third-party scripts with better performance, privacy, security and DX. Includes many popular third-parties out of the box.

[Get started](https://scripts.nuxt.com/docs/getting-started) [Star on GitHub](https://github.com/nuxt/scripts)

[Ahrefs Web Analytics](https://scripts.nuxt.com/scripts/ahrefs-analytics) [Plausible Analytics](https://scripts.nuxt.com/scripts/plausible-analytics) [Cloudflare Web Analytics](https://scripts.nuxt.com/scripts/cloudflare-web-analytics) [Vercel Analytics](https://scripts.nuxt.com/scripts/vercel-analytics) [PostHog](https://scripts.nuxt.com/scripts/posthog) [Fathom Analytics](https://scripts.nuxt.com/scripts/fathom-analytics) [Matomo Analytics](https://scripts.nuxt.com/scripts/matomo-analytics) [Rybbit Analytics](https://scripts.nuxt.com/scripts/rybbit-analytics) [Databuddy Analytics](https://scripts.nuxt.com/scripts/databuddy-analytics) [Segment](https://scripts.nuxt.com/scripts/segment) [Mixpanel](https://scripts.nuxt.com/scripts/mixpanel-analytics) [![Pulse Analytics logo](https://cdn.ciphera.net/pulse/pulse_icon_64.png)](https://scripts.nuxt.com/scripts/pulse-analytics "Pulse Analytics") [Bing UET](https://scripts.nuxt.com/scripts/bing-uet) [Meta Pixel](https://scripts.nuxt.com/scripts/meta-pixel) [X Pixel](https://scripts.nuxt.com/scripts/x-pixel) [TikTok Pixel](https://scripts.nuxt.com/scripts/tiktok-pixel) [Snapchat Pixel](https://scripts.nuxt.com/scripts/snapchat-pixel) [Reddit Pixel](https://scripts.nuxt.com/scripts/reddit-pixel) [LinkedIn Insight Tag](https://scripts.nuxt.com/scripts/linkedin-insight) [Google Adsense](https://scripts.nuxt.com/scripts/google-adsense) [Intercom](https://scripts.nuxt.com/scripts/intercom) [Hotjar](https://scripts.nuxt.com/scripts/hotjar) [![Clarity logo](https://store-images.s-microsoft.com/image/apps.29332.512b1d3d-80ec-4aec-83bb-411008d2f7cd.76371b6f-9386-463f-bfb0-b75cffb86a4f.bd99f4b1-b18e-4380-aa79-93768763c90d.png)](https://scripts.nuxt.com/scripts/clarity "Clarity") [Stripe](https://scripts.nuxt.com/scripts/stripe) [Lemon Squeezy](https://scripts.nuxt.com/scripts/lemon-squeezy) [PayPal](https://scripts.nuxt.com/scripts/paypal) [Vimeo Player](https://scripts.nuxt.com/scripts/vimeo-player) [YouTube Player](https://scripts.nuxt.com/scripts/youtube-player)

## **Better Web Vitals**

Load scripts when they're needed with best practices non-blocking the rendering of your Nuxt app by default.

## **Privacy for your users**

Avoid leaking user data to third-party scripts that don't need it. Ensure your scripts are GDPR compliant.

## **Secure third-parties**

Protect your app from third-party scripts that could be compromised.

## **A powerful API with ***just enough*** magic **

Nuxt Scripts provides an abstraction layer on top of third-party scripts, providing SSR support and type-safety while still giving you full low-level control over how a script is loaded.

app.vue

```
const { proxy } = useScript('/tracker.js', {
  trigger: 'onNuxtReady',
  use() {
    return { trackEvent: window.trackEvent }
  }
})

// fully typed, SSR safe
proxy.trackEvent('page_view')
```

## Speed up with Facade Components

Nuxt Scripts provides several [Facade Components](https://developer.chrome.com/docs/lighthouse/performance/third-party-facades) out of the box.

Facade components are fake UI elements that get replaced once a third-party script loads, they can significantly improve your performance while still providing a great user experience, however they do have [trade-offs](https://scripts.nuxt.com/docs/guides/facade-components) .

### **Google Maps**

**Nuxt Scripts****11.9x Faster **

70ms

**Iframe**

830ms

### **YouTube**

**Nuxt Scripts****46.4x Faster **

70ms

**Iframe**

3.3s

### **Vimeo**

**Nuxt Scripts****3.7x Faster **

70ms

**Iframe**

260ms

### **Intercom**

**Nuxt Scripts****3.9x Faster **

220ms

**Iframe**

850ms

\*Note that PageSpeed Insights lab data is a snapshot from a particular day, which tends to be variable.

## **Cookie consent, typed per vendor **

Every consent-aware script returns a `consent` object matching the vendor's native API, paired with `defaultConsent` applied before the first call.

Google Consent Mode v2, Meta grant/revoke, Matomo give/forget, TikTok three-state and more. Bridge OneTrust or Cookiebot, or ship your own banner with [useScriptTriggerConsent](https://scripts.nuxt.com/docs/guides/consent) .

consent.ts

```
const { consent } = useScriptGoogleAnalytics({
  id: 'G-XXXXXXXX',
  defaultConsent: {
    ad_storage: 'denied',
    analytics_storage: 'denied',
  },
})

// Google Consent Mode v2
consent.update({
  ad_storage: 'granted',
  analytics_storage: 'granted',
})
```

## **Privacy-first social embeds **

Embed posts from X, Instagram, and Bluesky without loading third-party scripts. All content is fetched server-side and proxied through your domain.

Zero client-side JavaScript, zero cookies, zero third-party requests.

Privacy and performance comparison between Nuxt Scripts and native social embeds

| **Nuxt Scripts vs Native ** | X | Instagram | Bluesky |
| --- | --- | --- | --- |
| **Client JS ** | **0**vs475 KB | **0**vs580 KB | **0**vs42 KB |
| **Requests ** | **0**vs25 | **0**vs34 | **0**vs9 |
| **Cookies ** | **No**vsYes | **No**vsYes | **No**vsNo |
| **Blocking Time ** | **0ms**vs1,010ms | **0ms**vs780ms | **0ms**vs60ms |

### Live social embed demos

Live social demos load when this section approaches the viewport.

## **Watch the intro videos from the pros. **

![Play video](https://i.ytimg.com/vi_webp/sjMqUUvH9AE/hq720.webp)

![Play video](https://i.ytimg.com/vi_webp/jDQtxlRUf54/hq720.webp)

## A faster web collaboration

Nuxt Scripts was designed and built by the Nuxt core team in collaboration with the [Chrome Aurora](https://developer.chrome.com/aurora) team at Google.

Nuxt Scripts is being actively maintained by the Nuxt core team and amazing community contributors, we welcome all contributions.

## **Community Funded **

Nuxt Scripts is free and open-source thanks to generous community sponsors.

[**Become a sponsor **](https://github.com/sponsors/harlan-zw)

The sponsor list is unavailable right now.

## **Try out our JS Confetti Tutorial **

Learn all of the fundamentals of Nuxt Scripts in the fun interactive confetti tutorial.

[**Get started **](https://scripts.nuxt.com/docs/getting-started/confetti-tutorial)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scripts.nuxt.com/#website","@type":"WebSite","description":"Nuxt Scripts lets you load third-party scripts with better performance, privacy, security and DX. It includes many popular third-parties out of the box.","name":"Nuxt Scripts","url":"https://scripts.nuxt.com/","publisher":{"@id":"https://scripts.nuxt.com/#identity"}},{"@id":"https://scripts.nuxt.com/#webpage","@type":"WebPage","description":"Better performance, privacy, security and DX for third-party scripts.","name":"Load Third-Party Scripts in Nuxt","url":"https://scripts.nuxt.com/","about":{"@id":"https://scripts.nuxt.com/#identity"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/"]}],"primaryImageOfPage":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/#identity","@type":"Organization","name":"Nuxt Scripts","url":"https://scripts.nuxt.com","logo":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/#logo","@type":"ImageObject","caption":"Nuxt Scripts","contentUrl":"https://scripts.nuxt.com/logo.svg","inLanguage":"en","url":"https://scripts.nuxt.com/logo.svg"}]}
```

## Sitemap

See the full [sitemap](https://scripts.nuxt.com/sitemap.md) for all pages.
