Skip to content

Update Plausible integration to use Script instead of API#1217

Open
addisonschultz wants to merge 2 commits into
mainfrom
fix/plausible-init
Open

Update Plausible integration to use Script instead of API#1217
addisonschultz wants to merge 2 commits into
mainfrom
fix/plausible-init

Conversation

@addisonschultz

Copy link
Copy Markdown
Collaborator

Migrates the Plausible integration from a custom API-based tracking implementation to Plausible's official script tag approach.

Previously, the integration served a hand-rolled tracking script that posted events directly to the Plausible Events API. This required users to configure their tracked domain separately and bundled a large JS implementation that could drift from Plausible's own script.

The new approach injects Plausible's hosted script (e.g. https://plausible.io/js/pa-XXXX.js) dynamically, keeping tracking behaviour fully in sync with Plausible's own releases.

Configuration changes:

  • domain → scriptKey: the pa-XXXX key from the user's Plausible snippet URL (required)
  • api → selfHostedUrl: base URL for self-hosted Plausible instances (optional, unchanged in purpose)

@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d879b17

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@gitbook/integration-plausible Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

bun add https://pkg.pr.new/GitbookIO/integrations/@gitbook/api@1217

commit: d879b17

@addisonschultz addisonschultz requested a review from jpreynat June 23, 2026 22:45
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.

1 participant