@@ -25,7 +25,10 @@ export default defineNuxtConfig({
2525 scripts: {
2626 registry: {
2727 plausibleAnalytics: {
28- domain: ' YOUR_DOMAIN'
28+ // Get this from your Plausible script URL:
29+ // https://plausible.io/js/pa-gYyxvZhkMzdzXBAtSeSNz.js
30+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^
31+ scriptId: ' gYyxvZhkMzdzXBAtSeSNz'
2932 }
3033 }
3134 }
@@ -38,7 +41,7 @@ export default defineNuxtConfig({
3841 scripts: {
3942 registry: {
4043 plausibleAnalytics: {
41- domain : ' YOUR_DOMAIN ' ,
44+ scriptId : ' YOUR_SCRIPT_ID ' ,
4245 }
4346 }
4447 }
@@ -59,8 +62,8 @@ export default defineNuxtConfig({
5962 scripts: {
6063 plausibleAnalytics: {
6164 // .env
62- // NUXT_PUBLIC_SCRIPTS_PLAUSIBLE_ANALYTICS_DOMAIN =<your-domin >
63- domain : ' '
65+ // NUXT_PUBLIC_SCRIPTS_PLAUSIBLE_ANALYTICS_SCRIPT_ID =<your-script-id >
66+ scriptId : ' '
6467 },
6568 },
6669 },
@@ -75,8 +78,11 @@ export default defineNuxtConfig({
7578The ` useScriptPlausibleAnalytics ` composable lets you have fine-grain control over when and how Plausible Analytics is loaded on your site.
7679
7780``` ts
81+ // New October 2025 format
7882const plausible = useScriptPlausibleAnalytics ({
79- domain: ' YOUR_DOMAIN'
83+ // Extract from: https://plausible.io/js/pa-gYyxvZhkMzdzXBAtSeSNz.js
84+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^
85+ scriptId: ' gYyxvZhkMzdzXBAtSeSNz'
8086})
8187```
8288
@@ -112,10 +118,63 @@ export interface PlausibleAnalyticsApi {
112118You must provide the options when setting up the script for the first time.
113119
114120``` ts
115- export const PlausibleAnalyticsOptions = object ({
116- domain: string (), // required
117- extension: optional (union ([union (extensions ), array (union (extensions ))])),
118- })
121+ export interface PlausibleAnalyticsOptions {
122+ /**
123+ * Unique script ID for your site (recommended - new format as of October 2025)
124+ * Extract from: <script src="https://plausible.io/js/pa-{scriptId}.js"></script>
125+ */
126+ scriptId? : string
127+ /** Custom properties to track with every pageview */
128+ customProperties? : Record <string , any >
129+ /** Custom tracking endpoint URL */
130+ endpoint? : string
131+ /** Configure file download tracking */
132+ fileDownloads? : {
133+ fileExtensions? : string []
134+ }
135+ /** Enable hash-based routing for single-page apps */
136+ hashBasedRouting? : boolean
137+ /** Set to false to manually trigger pageviews */
138+ autoCapturePageviews? : boolean
139+ /** Enable tracking on localhost */
140+ captureOnLocalhost? : boolean
141+ /** Enable form submission tracking */
142+ trackForms? : boolean
143+ }
144+ ```
145+
146+ ``` ts
147+ export interface PlausibleAnalyticsDeprecatedOptions {
148+ /**
149+ * Your site domain
150+ * @deprecated Use `scriptId` instead (new October 2025 format)
151+ */
152+ domain? : string
153+ /**
154+ * Script extensions for additional features
155+ * @deprecated Use init options like `hashBasedRouting`, `captureOnLocalhost`, etc. instead
156+ */
157+ extension? : ' hash' | ' outbound-links' | ' file-downloads' | ' tagged-events' | ' revenue' | ' pageview-props' | ' compat' | ' local' | ' manual'
158+ }
159+
160+ ```
161+
162+ ** Note:** The ` scriptId ` is found in your Plausible dashboard under ** Site Installation** in your site settings.
163+
164+ ** Extracting your Script ID:**
165+
166+ Plausible provides you with a script tag like this:
167+
168+ ``` html
169+ <script async src =" https://plausible.io/js/pa-gYyxvZhkMzdzXBAtSeSNz.js" ></script >
170+ ```
171+
172+ Your ` scriptId ` is the part after ` pa- ` and before ` .js ` :
173+
174+ ``` ts
175+ scriptId : ' gYyxvZhkMzdzXBAtSeSNz'
176+ // ^^^^^^^^^^^^^^^^^^^^^^^
177+ // Extract from: pa-{scriptId}.js
119178```
120179
121180## Example
0 commit comments