Repository navigation
Expose window.GoDAM.hasAttributionConsent - #2395
Conversation
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 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. |
📁 inc/classes/class-media-library-ajax.php (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
1643 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound | Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "max_srcset_image_width". |
📁 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/19/demo-post-post/ (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-page-post/ (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/19/demo-post-post/ (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-page-post/ (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
left a comment
There was a problem hiding this comment.
Reviewed at 933adbf4c. CI is green (JS and PHP unit tests, PHPCS, Plugin Check). I read the code but did not run it on a site.
| Claim | How checked | Result |
|---|---|---|
godamLayerInteractions lives in sessionStorage |
utils/storage.js and utils/consent.js both use sessionStorage |
Correct, SESSIONSTORAGE is right |
| The 4 new functional items exist and match their text | NF / EVF / FF storeInLocalStorage() write { data, expiresAt: now + 10 min }; LifterLMS uses the godam_llms_video_progress_ prefix |
Correct |
| Every GoDAM browser item is now declared | grepped every localStorage / sessionStorage use under assets/src |
Two are still missing, see the inline comments |
window.GoDAM.hasAttributionConsent can be read whenever the script loads |
init() and Map_Tracker::maybe_enqueue_script() |
Correct, but the script only loads when MAP tracking is on and a player is on the page, see the inline comment |
Existing window.GoDAM helpers are kept |
analytics-helpers.js also uses window.GoDAM = window.GoDAM || {} |
Fine, nothing gets overwritten |
The inline comments are small additions; none of them blocks the PR.
| 'personal_data' => '', | ||
| ), | ||
| array( | ||
| 'name' => 'godam_llms_video_progress_*', |
There was a problem hiding this comment.
Two more GoDAM items still aren't declared anywhere:
uppyState:*(localStorage):godam-recorder/index.jsloads Uppy'sGoldenRetrieverwithexpires: 10 * 60 * 1000. It saves the recorder state underuppyState:<id>keys, and the NF form and the recorder clear them on submit (key.startsWith( 'uppyState:' )). GoldenRetriever also puts a copy of the recorded file in IndexedDB. This is the same feature as the three*-recorder-dataitems, so it belongs here as a functional item.godam-map-session-<jobId>(sessionStorage): written bygetSessionId()inmap-tracking.js, and sent to the marketing tool with each milestone. It's tied to marketing attribution, so it should go under themarketingcategory rather thanfunctionalorstatistics.
The other storage keys I found are already declared, or (godamPreviewDeviceView) only appear on the GoDAM preview page, not to site visitors.
There was a problem hiding this comment.
Heads-up: this PR has been re-scoped to only the hasAttributionConsent export in map-tracking.js. The consent-declaration work in class-visitor-consent.php was dropped from this branch and is now handled in #2394, so this feedback applies there rather than here. Flagging it for that PR; not resolving this thread.
| public static function get_functional_storage_items() { | ||
| return array( | ||
| array( | ||
| 'name' => 'godam-nf-recorder-data', |
There was a problem hiding this comment.
personal_data is empty for the three recorder items, but each one stores the URL of the video the visitor just recorded (@param {string} data File URL. in ninja-forms/index.js). A recording of someone's face and voice is personal data, so a banner should say so, for example __( 'Link to the video you recorded', 'godam' ).
Also a small one: the 10 minutes is only checked when the value is read. If the visitor never comes back to the form, the item stays in localStorage until it's next read. "Up to 10 minutes, cleared on submit or next visit" would be more accurate, but it's fine to leave as is.
There was a problem hiding this comment.
Heads-up: this PR has been re-scoped to only the hasAttributionConsent export in map-tracking.js. The consent-declaration work in class-visitor-consent.php was dropped from this branch and is now handled in #2394, so this feedback applies there rather than here. Flagging it for that PR; not resolving this thread.
Marketing/attribution tools, Woo's consent module included, expose nothing on window, so a site's banner or a tester could only infer whether GoDAM would attribute a view by watching for the request. The MAP tracker now publishes its own decision as window.GoDAM.hasAttributionConsent(), the inverse of a page-wide Global Privacy Control opt-out. It is set on init() before the connected-tool guard, so it is readable whenever the tracker script loads. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
933adbf to
d25f16b
Compare
Summary
Exposes
window.GoDAM.hasAttributionConsent()from the GoDAM map tracker so other code can read whether the visitor has consented to attribution tracking.The MAP tracker now publishes
window.GoDAM.hasAttributionConsent()— the inverse of a page-wide Global Privacy Control opt-out. It is set oninit(), before the connected-tool guard, so the value is available regardless of which analytics tool is connected.Where it is readable: the tracker script is only enqueued where MAP tracking is on (tracking enabled with at least one provider) and a player was rendered. On every other page
window.GoDAM.hasAttributionConsentisundefined— which itself means GoDAM will not attribute there. The helper reflects only the page-wide GPC opt-out, not the WP Consent API marketing decision.Scope note
This PR was trimmed to only the
hasAttributionConsentexport. The consent-storage declarations (SESSIONSTORAGE/functional-category declarations inclass-visitor-consent.php) are handled more completely in #2394, so they have been dropped from this branch to avoid duplication/conflicts.Changes
assets/src/js/godam-player/map-tracking.js— exposewindow.GoDAM.hasAttributionConsent().assets/src/js/godam-player/map-tracking.test.js— coverage for the exposed helper.Testing
npx jest assets/src/js/godam-player/map-tracking.test.js— 43/43 pass.npx eslint assets/src/js/godam-player/map-tracking.js— clean.🤖 Generated with Claude Code