Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@harlan-zw
Copy link
Collaborator

@harlan-zw harlan-zw commented Oct 14, 2025

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

⚠️ Not breaking but please test your plausible integration after updating.

Plausible introduced a new script format in October 2025 with unique per-site script IDs and plausible.init() for configuration instead of script extensions.

  1. Unique Script IDs: Each site now gets a unique script ID (found in Site Installation settings)
  2. No more extensions: Configuration is done via plausible.init() options instead of script extensions
  3. Simplified setup: Custom events, revenue tracking, and form submissions are now automatically available

We support the legacy usage of the script however it is now deprecated and users should migrate.

Migration Guide

Old format (domain + extensions):

useScriptPlausibleAnalytics({
  domain: 'example.com',
  extension: ['hash', 'outbound-links']
})

New format (scriptId + init options):

useScriptPlausibleAnalytics({
  scriptId: 'YOUR_SCRIPT_ID', // Get from Plausible dashboard
  hashBasedRouting: true,
  // outbound-links is now enabled by default
})

@vercel
Copy link

vercel bot commented Oct 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
scripts-docs Error Error Oct 14, 2025 4:47am
scripts-playground Ready Ready Preview Comment Oct 14, 2025 4:47am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 14, 2025

Open in StackBlitz

npm i https://pkg.pr.new/nuxt/scripts/@nuxt/scripts@534

commit: 4fd4a4b

Copy link
Member

@huang-julien huang-julien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about having two separate usePlausibleAnalytics composable ?

@harlan-zw
Copy link
Collaborator Author

harlan-zw commented Oct 14, 2025

I thought about this, but I don't want to have to manage a bunch of arbitrary version postfixes on composable name, it complicates docs, end user DX and testing.

I'd imagine the original way of embedding the script will work in perpetuity, so if the end user doesn't migrate off this, it's not a big deal.

Thanks for the review!

@harlan-zw harlan-zw changed the title feat: plausible script updates feat!: plausible script updates Oct 15, 2025
@harlan-zw harlan-zw merged commit 5c9a7aa into main Oct 15, 2025
8 of 9 checks passed
@harlan-zw harlan-zw deleted the feat/plausible-updates branch October 15, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants