Repository navigation
Conversation
|
The deployments were removed when this pull request closed. Reopening it deploys again at the same address. |
There was a problem hiding this comment.
🟡 Changes recommended
Standalone HTML docs still bypass VWO, and site-wide body hiding can temporarily blank pages when VWO is slow.
2 open findings
What changed in this PR
This PR aims to make docs visits available as VWO goals and pass analytics consent to VWO.
Changes:
- Loads the VWO snippet without the previous page-level condition.
- Initializes VWO from stored consent and updates it when a visitor makes a choice.
| File | Description |
|---|---|
public/docs/js/cookie-consent.js |
Sends analytics consent changes to VWO. |
_includes/marketing-vwo.html |
Loads VWO and sets its initial consent state. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -1,4 +1,28 @@ | |||
| {% if page.vwo or include.force_enabled %} | |||
| <script type="text/javascript" id="vwoConsent"> | |||
There was a problem hiding this comment.
scoped this to experiments pages paths only (empty for the docs repo)
| @@ -1,4 +1,28 @@ | |||
| {% if page.vwo or include.force_enabled %} | |||
| <script type="text/javascript" id="vwoConsent"> | |||
There was a problem hiding this comment.
good catch, injected the vwo script into those pages
losrebellos
left a comment
There was a problem hiding this comment.
- Agree with Copilot regarding
hide_element='body', it should be""or a narrow selector - VWO should be available on
productiononly, like other tracking, etc. libs we're using. WDYT?
|
Is there a way we can get vwo tracking behavior on every page while keeping the render-delaying behavior only on pages we're a/b testing? |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
efd5aff to
856b776
Compare
yes, by keeping a hardcoded list of experiment page paths and only enabling hide_element on those pages. A bit fragile since we’d need to keep the list up to date, but I think it’s worth it
updated, now we have only for the tested pages (no such pages in the docs repo btw)
agree, updated |


Docs counterpart of metabase/metabase.github.io#6645, same change. Closes GRO-1076. Decision and trade-offs: VWO vs mb_track (we chose approach A).
vwo: true, which no page set), so docs visits can be VWO goals.VWO.init(1 | 2 | 3)) so its "Partially Block" mode can hold tracking until consent.Important
Ship together with metabase/metabase.github.io#6645. Right after both are deployed, switch on Enable Cookie Consent → Other → Partially Block in the VWO account. Until it's on, VWO ignores consent and tracks every visitor.
How to verify
bunx astro dev.<head>, so that's fine for this check.visualwebsiteoptimizer, type All, tick Disable cache:j.phpandcollect/v.gifshow that VWO is loaded.window.VWO.consentState:1outside restricted countries, or2(pending) if you're in one.get.geojs.io(a failed geo lookup is treated as restricted). Clear site data and reload:consentStateis2.consentStatebecomes1.consentStatebecomes3.consentStateis3right away, because the stored choice is passed to VWO before the snippet runs.