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

refactor(analytics): conditionally load plausible based on domain presence #6459

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

yhabib
Copy link
Contributor

@yhabib yhabib commented Feb 19, 2025

Motivation

Now that we have confirmed the tool works, we can remove its configuration from the devenv and e2e environments. This way, we will only load it for the following networks:

  • mainnet
  • betta and app

Changes

  • Do not default the env. variable PLAUSIBLE_DOMAIN to empty string.
  • Do not load Plausible if no domain has been loaded.

Tests

  • Unit test the behavior based on the presence of the domain property.

Todos

  • Add entry to changelog (if necessary).
    Not necessary

Next PR: #6458

@yhabib yhabib changed the title if no value don't initialize it refactor(analytics): remove plausible from development environments Feb 19, 2025
@yhabib yhabib marked this pull request as ready for review February 20, 2025 06:18
@yhabib yhabib requested a review from a team as a code owner February 20, 2025 06:18
@yhabib yhabib changed the title refactor(analytics): remove plausible from development environments refactor(analytics): conditionally load plausible based on domain presence Feb 20, 2025
Copy link
Contributor

@mstrasinskis mstrasinskis left a comment

Choose a reason for hiding this comment

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

Looks good, just a non-blocking question.

@yhabib yhabib added this pull request to the merge queue Feb 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 20, 2025
@yhabib yhabib added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit d9f24cd Feb 20, 2025
32 checks passed
@yhabib yhabib deleted the yhabib/analytics/cleanup branch February 20, 2025 19:52
github-merge-queue bot pushed a commit that referenced this pull request Feb 20, 2025
#6458)

# Motivation

We want to only load Plausible for `mainnet`, `beta` and `app` networks.

# Changes

- Moved Plausible test domain from the default to the app and beta
section in config.json.
- Ran `./scripts/nns-dapp/test-config --update` but no changes were
generated.

# Tests

- Ran config scripts and observed:
- `DFX_NETWORK=mainnet ./config.sh` ->
`VITE_PLAUSIBLE_DOMAIN=nns.ic0.app`
- `DFX_NETWORK=beta ./config.sh` ->
`VITE_PLAUSIBLE_DOMAIN=test.nns.ic0.app`
- `DFX_NETWORK=app ./config.sh` ->
`VITE_PLAUSIBLE_DOMAIN=test.nns.ic0.app`
  - `DFX_NETWORK=local ./config.sh` -> `VITE_PLAUSIBLE_DOMAIN=`

# Todos

- [ ] Add entry to changelog (if necessary).
Not necessary

Prev. PR: #6459
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