Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added possibility of custom plausible domain #2

Merged
merged 7 commits into from
Jul 21, 2021

Conversation

mascali33
Copy link
Contributor

Added an option to use custom plausible domain in grav admin

Modified php file to reflect changes in config

Lang file need to be reworked, did "en" but not the other langs

@@ -18,6 +18,9 @@ en:
ENABLE_OUTBOUND_LINK_TRACKING_HELP: See https://docs.plausible.io/outbound-link-click-tracking.
TRACK_OUTBOUND: Yes
DONT_TRACK_OUTBOUND: No

PLUGIN_PLAUSIBLE.CUSTOM_PLAUSIBLE_DOMAIN: Custom plausible domain?
PLUGIN_PLAUSIBLE.CUSTOM_PLAUSIBLE_DOMAIN_HELP: Only use if you self-hosted plausible
Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Owner

@iainsgillis iainsgillis left a comment

Choose a reason for hiding this comment

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

Hi -- Thanks for initiating this!

I've added a couple of comments about specific lines. In languages.yaml, the help text about the new field you've suggested (self-hosted vs custom domain) will ultimately have ramifications on the README and in the translations, so I want to be clear about that before proceeding.

In general, what do you think about adding a toggle (enabled/disabled) in addition to the custom domain field? I'm guessing that most users (like myself) use the hosted Plausible service with the default setup.

Adding a toggle doesn't complicate the UI much, and is a little more intentional for users who wish to setup a custom domain (whether by running their own docker instance, or the CNAME record).

My concern is that the semantics are a little confusing if we use the placeholder of a custom value as the default value for the stock configuration that Plausible's hosted service ships with.

Also, adding a toggle gives users an easy way to undo changes when rolling out a custom domain setup.

@rootarch @Audiotape-2 -- since you're among the very few who have starred this repo (thanks!): do you have any thoughts about the toggle/custom domain field implementation?

Thanks again for moving this plugin forward.

plausible.php Show resolved Hide resolved
@rootarch
Copy link

@iainsgillis I like the simplicity of the toggle to easily enable/disable the Custom Domain feature.

I also agree with your thoughts about using https://plausible.io/ as the default value for a custom variable. Is it worth defining logic that uses https://plausible.io/ as the default, ignoring the Custom Domain field if it is left blank/empty?

@iainsgillis
Copy link
Owner

Hi, Folks --

Apologies for the delay: bit of a busy stretch personally and professionally.

Appreciate the initial pull request, @mascali33, and your weigh-in @rootarch. I'm going to proceed with this beginning this evening and hope to release it by the weekend.

Cheers,
Iain

@iainsgillis iainsgillis merged commit 1ff9416 into iainsgillis:main Jul 21, 2021
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.

None yet

3 participants