Skip to content

Consent follow-ups: "Track visitors" setting, privacy-policy text, and the browser items in the readme - #2374

Merged
rudrakshi-gupta merged 6 commits into
developfrom
fix/consent-follow-ups-55
Nov 18, 2026
Merged

rudrakshi-gupta merged 6 commits into
developfrom
fix/consent-follow-ups-55

Conversation

@subodhr258

@subodhr258 subodhr258 commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Part of the 2.10.1 release: https://github.com/rtCamp/godam-plugin-wp/issues/112

What this does

The GoDAM half of the consent follow-ups still open on Let sites hold video analytics until the visitor consents (items 3, 4 and 5 of this comment), for GoDAM 2.10.1. The consent gate itself shipped in 2.8.0 (#2332).

Item Before After
4. Turn visitor tracking off without code Only the godam_visitor_tracking_enabled filter GoDAM > Settings > General > "Track visitors", on by default. The setting is the filter's default, so a site's filter still wins
3. Privacy-policy text None Settings > Privacy > Policy Guide shows GoDAM's suggested text: what goes to analytics.godam.io, the three browser items, and that nothing is stored or sent before consent with a WP Consent API banner
5. Readme analytics.godam.io listed 5 data points and no browser storage Lists what is sent (IP read from the request, anonymous ID (no WordPress user ID: the field is always 0 since 2.8.0), page and referrer, UTM, video and played parts, layer clicks, browser details), when, and the 3 browser items with their storage type and lifetime. FAQ mentions the setting. README.md table matches

How

  • Visitor_Consent::is_tracking_setting_enabled() reads rtgodam-settings > general > enable_visitor_tracking. A missing key means on, so sites updating from 2.8.0 keep tracking.
  • is_tracking_enabled() passes that value as the filter's default. Nothing else changes in the front end: it already reads videoAnalyticsParams.consent.trackingEnabled.
  • Settings REST: new default and sanitizer entry; Redux slice default true; one ToggleControl in General Settings.
  • add_privacy_policy_content() on admin_init. The list of items comes from get_storage_items(), the same list the WP Consent API gets, so the two can't drift.

Testing

  • VisitorConsentTest: 5 new tests (12 total): setting off stops tracking, a missing key keeps it on, the filter overrides the setting, the privacy text names analytics.godam.io and every browser item, the text is hooked on admin_init. Full PHPUnit: 1471 pass.
  • PHPCS clean on changed PHP. ESLint clean on changed JS. jest pages/godam passes. npm run build:prod passes.
  • Not yet tested on a site: toggling the switch and checking that no /analytics/ request and no __anon_id appear; the Policy Guide screen. QA steps below.

QA steps

  1. GoDAM > Settings > General: "Track visitors" is on. Open a page with a GoDAM video in a private window: __anon_id is in local storage and analytics.godam.io requests are sent.
  2. Turn "Track visitors" off and save. Reload the page in a new private window: no __anon_id, no godamVideoSeen: keys, no analytics.godam.io requests (play the video, click a layer, leave the page).
  3. With add_filter( 'godam_visitor_tracking_enabled', '__return_true' ); in a mu-plugin, tracking runs even with the switch off.
  4. Settings > Privacy > Policy Guide: a GoDAM section with the suggested text and the three items.

Risk risk: low: default is unchanged; the switch only turns tracking off.


Generated by Claude Code

…ser storage in the readme

- GoDAM > Settings > General gets a "Track visitors" switch (general.enable_visitor_tracking,
  on by default). It is the default for the godam_visitor_tracking_enabled filter, so the
  filter still wins.
- Suggested privacy-policy text through wp_add_privacy_policy_content().
- readme.txt and README.md: the analytics.godam.io entry lists the data sent and the
  three items GoDAM keeps in the browser.

Items 3, 4 and 5 of rtCamp/godam-plugin-wp#55.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MexDKVufPym43bCVfuHnms
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
14 0 14

⚠️ Warnings (14)

📁 readme.txt (2 warnings)
📍 Line 🔖 Check 💬 Message
0 mismatched_plugin_name Plugin name "GoDAM - Video Hosting for LMS & Online Courses" is different from the name declared in plugin header "GoDAM".
0 readme_parser_warnings_trimmed_section_description The "Description" section is too long and was truncated. A maximum of 2500 characters is supported.
📁 assets/build/pages/video-editor.min.js (1 warning)
📍 Line 🔖 Check 💬 Message
2 react_removed_api This file calls "ReactDOM.findDOMNode", which was removed in React 19 and stops working once WordPress upgrades React. Use a ref on the element instead.
📁 assets/build/css/main.css (1 warning)
📍 Line 🔖 Check 💬 Message
0 EnqueuedStylesScope This style is being loaded in all contexts.
📁 assets/src/libs/analytics.min.js (5 warnings)
📍 Line 🔖 Check 💬 Message
0 EnqueuedScriptsScope This script is being loaded in all frontend contexts.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/2026/11/17/hello-world/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/sample-page/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/demo-attachment-post/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead.
📁 assets/build/js/main.min.js (5 warnings)
📍 Line 🔖 Check 💬 Message
0 EnqueuedScriptsScope This script is being loaded in all frontend contexts.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/2026/11/17/hello-world/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/sample-page/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/demo-attachment-post/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead.

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@subodhr258 subodhr258 added the risk: medium Agent QA plus a human spot check label Nov 16, 2026
… user ID

The player sends wp_user_id from the page's userId, which is always 0 since 2.8.0.
The suggested privacy-policy text and both readmes said the ID is sent.
@KMchaudhary

Copy link
Copy Markdown
Collaborator

Code review — looks solid. Settings/REST/Redux wiring, the filter-default chaining, and the privacy-policy text are all consistent, and the tests cover the important paths (missing key → on, filter overrides setting). No correctness bugs found. Two minor notes:

  1. readme.txt forward-promises Woo behavior. The FAQ now says "GoDAM for Woo 2.3.1 and later follows the same choice." If feat: Add optional chaining to avoid console errors #272 hasn't shipped as Woo 2.3.1 by the time this readme goes live, users on the current Woo release see a promise the plugin doesn't yet keep. Worth gating the wording on that release landing.

  2. Test stub leaks across the process. test_suggests_privacy_policy_text defines wp_add_privacy_policy_content() via eval, which persists for the whole PHP process. Any later test that relies on the function being absent (to exercise the function_exists() guard in add_privacy_policy_content()) would silently pick up this stub depending on test order — the absent-function branch is effectively never covered.

Neither blocks merge.

Reviewed with Claude Code

Copy link
Copy Markdown
Collaborator Author

Thanks @KMchaudhary.

  1. That FAQ line is already true: GoDAM for Woo 2.3.1 shipped on 10 Nov with rtCamp/godam-for-woo#254, which makes Shoppable Video and Reel Pop counts and the attribution items wait for the same "statistics" choice. rtCamp/godam-for-woo#272 is a separate, later change (marketing consent for attribution) and this readme doesn't mention it, so nothing here waits on feat: Add optional chaining to avoid console errors #272.
  2. Agreed: the eval stub stays for the rest of the process, so the function_exists() guard's absent branch is never covered. No test relies on the function being absent today, so I'll move that test to @runInSeparateProcess and add an absent-function case in the next push rather than push for it alone.

Replied with Claude Code


Generated by Claude Code

@rudrakshi-gupta

Copy link
Copy Markdown
Member

Code review

Verdict: LGTM, no blocking issues. The setting is wired in the least risky way: it only changes the default of godam_visitor_tracking_enabled, so a site's filter still wins, a missing key means on (sites updating from 2.8.x keep tracking), and the front end needs no change because it already reads videoAnalyticsParams.consent.trackingEnabled.

What I ran (head of fix/consent-follow-ups-55)

Check Result
VisitorConsentTest 12/12 pass
Full PHPUnit 1471 tests pass
PHPCS (class-visitor-consent.php, class-settings.php, test) / ESLint (GeneralSettings.jsx, media-settings.js) Clean
POT Includes the new strings; all 14 refs for class-visitor-consent.php point at their translation calls

What I verified

Suggestions (non-blocking)

  1. The help text vs the GTM option. "GoDAM stores nothing in visitors' browsers and sends no view or click events" is true for GoDAM analytics. But with Enable Google Tag Manager tracking on, gtm-video-tracker.js still pushes video events into the site's dataLayer; it has no consent or tracking-setting gate (pre-existing, not from this PR). Adding "to GoDAM analytics", or "the Google Tag Manager option is separate", would stop an admin thinking one switch stops both.
  2. Page caches. trackingEnabled is printed into the page, so turning the switch off only takes effect on cached pages once the cache is purged. A short "Purge your page cache after changing this" in the help text (or the readme FAQ) would save a support ticket.
  3. UTM in the privacy text. The readme now lists UTM parameters among what's sent, but the suggested policy paragraph doesn't mention them ("...the page you are on and the page that referred you, including campaign (UTM) parameters..."). It's minor, but the two lists should match.

Copy link
Copy Markdown
Collaborator Author

Thanks @rudrakshi-gupta. All three hold; I checked the first one: gtm-video-tracker.js has no consent or tracking-setting check, so the GTM dataLayer pushes carry on with "Track visitors" off.

  1. I'll make the help text say "to GoDAM analytics" and that the Google Tag Manager option is separate. Gating the GTM pushes themselves is a separate change, so I'll leave that to @subodhr258 as a follow-up.
  2. I'll add the cache purge note to the help text and the readme FAQ.
  3. I'll add campaign (UTM) parameters to the suggested policy text so it matches the readme.

All three go in the next push, with @KMchaudhary's test-isolation note, rather than a push for them alone.

Replied with Claude Code


Generated by Claude Code

KMchaudhary
KMchaudhary previously approved these changes Nov 17, 2026
…ated privacy test

- "Track visitors" help text and readme FAQ: the switch covers GoDAM analytics;
  the Google Tag Manager option is separate; purge the page cache after changing it.
- Suggested privacy text names campaign (UTM) parameters, as the readme does.
- VisitorConsentTest: the wp_add_privacy_policy_content() stub runs in its own
  process, and a new test covers the function_exists() guard.
- POT regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MexDKVufPym43bCVfuHnms

Copy link
Copy Markdown
Collaborator Author

Merged main (2.10.0) into this branch to clear the POT conflict, which dismissed the approval. Then 13d9d76 folds in the review notes:

  • @rudrakshi-gupta: the "Track visitors" help text and FAQ now say the switch covers GoDAM analytics and the Google Tag Manager option is separate. Both also say to purge the page cache after changing it. The suggested privacy text names campaign (UTM) parameters.
  • @KMchaudhary: the privacy-text test runs in its own process, and a new test covers the function_exists() guard.

PHPUnit (1599) and ESLint pass. The POT is regenerated.

Posted with Claude Code


Generated by Claude Code

@rudrakshi-gupta
rudrakshi-gupta changed the base branch from main to develop November 18, 2026 14:04
@rudrakshi-gupta
rudrakshi-gupta merged commit 82a21be into develop Nov 18, 2026
10 checks passed
@rudrakshi-gupta
rudrakshi-gupta deleted the fix/consent-follow-ups-55 branch November 18, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium Agent QA plus a human spot check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants