I submitted -- and you merged, thank you!! -- a PR for enabling stat counter analytics/page counter. But I am still seeing problems in having the script executed because it is not hashed, etc. So I think I've come up with a better way to include analytics that doesn't involve adding in-line scripts, etc.
in /assets/scripts/features
analytics
├── index.js
├── posthog.js
└── statcounter.js
in `features/index.js
if (process.env.FEATURE_ANALYTICS === '1') {
import('./analytics')
}
in features/analytics/index.js
import * as params from '@params';
if (params.analytics) { // probably don't need this one
if (params.analytics.statcounter) {
import('./statcounter');
}
if (params.analytics.posthog) {
import('./posthog');
}
if (params.analytics.matomo) {
import('./matomo')l
}
}
Question
I submitted -- and you merged, thank you!! -- a PR for enabling stat counter analytics/page counter. But I am still seeing problems in having the script executed because it is not hashed, etc. So I think I've come up with a better way to include analytics that doesn't involve adding in-line scripts, etc.
in /assets/scripts/features analytics ├── index.js ├── posthog.js └── statcounter.js
in `features/index.js
in
features/analytics/index.js
assets/scripts/features/statcounter.js
Now all script elements are included in
application.js
and are hashed, so noin-line
scripts.What do you think?