Skip to content

docs: load Plausible on invoke.ai (custom), not ghpages#9161

Open
Pfannkuchensack wants to merge 4 commits into
invoke-ai:mainfrom
Pfannkuchensack:fix/plausible-on-custom-domain
Open

docs: load Plausible on invoke.ai (custom), not ghpages#9161
Pfannkuchensack wants to merge 4 commits into
invoke-ai:mainfrom
Pfannkuchensack:fix/plausible-on-custom-domain

Conversation

@Pfannkuchensack
Copy link
Copy Markdown
Collaborator

Summary

Plausible was being injected on the ghpages target, which redirects to invoke.ai and therefore never serves analytics. Flip the conditional so the script loads on the actual production custom-domain build.

Merge Plan

This only applies to the invoke.ai website.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

Plausible was being injected on the ghpages target, which redirects to
invoke.ai and therefore never serves analytics. Flip the conditional so
the script loads on the actual production custom-domain build.
@github-actions github-actions Bot added the docs PRs that change docs label May 12, 2026
@joshistoast
Copy link
Copy Markdown
Collaborator

Wouldn't this show plausible on local?

@Pfannkuchensack
Copy link
Copy Markdown
Collaborator Author

Right now it is not working on invoke.ai and yes that would also show on local.

@joshistoast
Copy link
Copy Markdown
Collaborator

joshistoast commented May 12, 2026

The best approach may be setting an env variable in the deploy action ENABLE_ANALYTICS to true, and checking that in the config.

Something along the lines of:

const enableAnalytics = process.env.ENABLE_ANALYTICS === 'true';

That way only a deployment would get tracked, unless of course someone strips the config condition, runs a build and bombards the endpoint.

UPDATE: I'd assume plausible only accepts requests from the configured domain? If so then I don't think what I said above matters too much.

Only inject the tracking script when ENABLE_ANALYTICS=true, which the
deploy workflow sets exclusively on main-branch pushes. Keeps local
builds, PR builds, and manual workflow_dispatch runs analytics-free.
@github-actions github-actions Bot added the CI-CD Continuous integration / Continuous delivery label May 12, 2026
Copy link
Copy Markdown
Collaborator

@joshistoast joshistoast left a comment

Choose a reason for hiding this comment

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

No notes on the rest, made a code suggestion for keeping analytics on manual pushes

Comment thread .github/workflows/deploy-docs.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-CD Continuous integration / Continuous delivery docs PRs that change docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants