Repository navigation
Keep Ceros analytics off in SSR Store mode - #52
Merged
Merged
Conversation
A stored copy doesn't include the reporting bundle, and Ceros analytics events aren't versioned, so a stored runtime that falls behind could report events the pipeline no longer reads. Store mode is for a page that doesn't depend on Ceros, so it now reports nothing. - ceros_flex_tracking_enabled() returns false in Store mode (SSR delivery with a stored copy), including when the stored copy can't be read and the block falls back. A stored copy left behind after switching to another delivery mode doesn't count. - The sidebar shows the switch off and disabled in Store mode, without changing the saved choice, which comes back when the stored copy is removed. - Unit, JS and e2e coverage for the rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
danwashable
approved these changes
Oct 16, 2026
KarolNov
marked this pull request as ready for review
October 16, 2026 16:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Follow-up to #41, from the review thread. Store mode stores the experience but not the analytics script. Ceros analytics events aren't versioned, so a stored runtime that falls behind could report events the pipeline no longer reads. Storing the script as well wouldn't fix that, and Ceros exports have never carried analytics, because customers who host a copy don't want to depend on Ceros. We agreed to turn analytics off in Store mode for now.
What
ceros_flex_tracking_enabled()returns false when the block is in Store mode (ceros_flex_is_store_mode(): SSR delivery with astoredIndexPath). Every delivery path writesdata-ceros-analytics="disabled", including the fallbacks used when the stored copy can't be read. A stored copy left behind after switching to Inline or iframe doesn't count, becauserender.phponly reads it for SSR.cerosAnalyticsvalue isn't changed, so the author's choice comes back when they remove the stored copy.isStoreMode()inconstants.jsmirrors the PHP rule.Testing
isStoreMode(). Lint and build are clean.analytics-tracking.spec.tsgains a Store-mode case: switch on, stored copy unreadable, rendersdisabled. It passes against wp-env and fails with the rule removed.true. Removing the stored copy turns it back on.Not verified
ceros_render_flex_ssr_stored()itself. That path takes the same$tracking.🤖 Generated with Claude Code