Skip to content

docs: add-plausible - #348

Merged
aboydnw merged 1 commit into
mainfrom
add-plausible
Mar 18, 2026
Merged

aboydnw merged 1 commit into
mainfrom
add-plausible

Conversation

@aboydnw

@aboydnw aboydnw commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

I created a new site in plausible and added the custom script here.

@aboydnw
aboydnw requested a review from kylebarron March 18, 2026 15:06
@kylebarron kylebarron changed the title task: add-plausible docs: add-plausible Mar 18, 2026
@kylebarron
kylebarron requested a review from Copilot March 18, 2026 15:07
@github-actions github-actions Bot added the docs label Mar 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds Plausible analytics tracking to the Docusaurus docs site by injecting Plausible script tags into the HTML <head> via the Docusaurus config.

Changes:

  • Add Plausible <script> tag loading a custom Plausible JS asset.
  • Add an inline bootstrap snippet to initialize/queue Plausible calls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/docusaurus.config.ts
Comment on lines +183 to +196
headTags: [
{
tagName: "script",
attributes: {
async: "true",
src: "https://plausible.io/js/pa-GXbpwCRHPm1QSDOLNB_on.js",
},
},
{
tagName: "script",
attributes: {},
innerHTML: `window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};plausible.init()`,
},
],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Plausible ignores localhost traffic by default, I don't think we need to add this.

Comment thread docs/docusaurus.config.ts
Comment on lines +186 to +195
attributes: {
async: "true",
src: "https://plausible.io/js/pa-GXbpwCRHPm1QSDOLNB_on.js",
},
},
{
tagName: "script",
attributes: {},
innerHTML: `window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};plausible.init()`,
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Plausible explicitly says to mark as async, so I don't think we should change this.

Comment thread docs/docusaurus.config.ts
Comment on lines +191 to +195
{
tagName: "script",
attributes: {},
innerHTML: `window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};plausible.init()`,
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Similarly, this is copied directly from Plausible and I'm hesitant to mess with it. I don't know what the benefit would be.

@aboydnw
aboydnw merged commit b51f23a into main Mar 18, 2026
7 of 8 checks passed
@aboydnw
aboydnw deleted the add-plausible branch March 18, 2026 17:27
@kylebarron

Copy link
Copy Markdown
Member

@aboydnw just realized that this doesn't have metrics on the published examples, which are deployed as independent static sites. Not sure if you want to change that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants