Skip to content

Show per-hotspot Direct revenue in the layer panel - #2088

Closed
subodhr258 wants to merge 2 commits into
feat/top-productsfrom
feat/per-hotspot-revenue-ui
Closed

Show per-hotspot Direct revenue in the layer panel#2088
subodhr258 wants to merge 2 commits into
feat/top-productsfrom
feat/per-hotspot-revenue-ui

Conversation

@subodhr258

Copy link
Copy Markdown
Collaborator

What

Shows per-hotspot Direct revenue in the video layer-analytics panel (Sub-task C core; pairs with rtCamp/godam-analytics#259).

  • useVideoLayerData: maps revenue_minor / orders / currency onto each sub-hotspot from the endpoint row; the parent carries the sum of its hotspots' revenue (currency from any child).
  • SubHotspotRail: a small secondary line per hotspot, "<amount> · N orders", shown only when that hotspot has orders (Woo layers only), so the rail stays scannable.
  • LayerDetailPanel: a headline "This hotspot/layer drove <amount> across N orders" above the funnel, with an InfoTooltip stating it is the Direct in-video contribution only, not the product's total (Assisted purchases via the product page are excluded). Reuses the shipped formatRevenue (correct ISO fraction digits, full numbers).
  • WP proxy: passes base_currency = get_option('woocommerce_currency') to /processed-layer-analytics/.

Single store currency

Per-hotspot revenue sums base-currency orders only; other currencies are excluded server-side (counted on the dashboard, never converted here). Direct-only because a hotspot carries a layer_id; Assisted purchases have none.

Base branch

Targets feat/top-products (#2086, where formatRevenue shipped). Nothing merges to develop until Phase 2 is complete.

Part of rtCamp/godam-plugin-wp#26.

Sub-task C (core). Consumes the per-hotspot revenue the layer-analytics endpoint
now returns.

- useVideoLayerData: map revenue_minor/orders/currency onto each sub-hotspot; the
  parent carries the sum of its hotspots' revenue (currency from any child).
- SubHotspotRail: a small secondary line per hotspot, "<amount> · N orders",
  shown only when that hotspot has orders (Woo layers only).
- LayerDetailPanel: a headline "This hotspot/layer drove <amount> across N orders"
  above the funnel, with an InfoTooltip that it is the Direct in-video contribution
  only, not the product's total (Assisted purchases are excluded). Reuses the
  shipped formatRevenue (correct ISO fraction digits), full numbers.
- WP proxy: pass base_currency = get_option('woocommerce_currency') to
  /processed-layer-analytics/.

Base branch feat/top-products (#2086). Pairs with godam-analytics#259.
@github-actions

Copy link
Copy Markdown

🔍 WordPress Plugin Check Report

❌ Status: Failed

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
17 1 16

❌ Errors (1)

📁 readme.txt (1 error)
📍 Line 🔖 Check 💬 Message
0 outdated_tested_upto_header Tested up to: 7.0 < 7.1. The "Tested up to" value in your plugin is not set to the current version of WordPress. This means your plugin will not show up in searches, as we require plugins to be compatible and documented as tested up to the most recent version of WordPress.

⚠️ Warnings (16)

📁 readme.txt (2 warnings)
📍 Line 🔖 Check 💬 Message
0 mismatched_plugin_name Plugin name "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" is different from the name declared in plugin header "GoDAM".
0 trademarked_term The plugin name includes a restricted term. Your chosen plugin name - "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" - contains the restricted term "wordpress" which cannot be used at all in your plugin name.
📁 composer.json (1 warning)
📍 Line 🔖 Check 💬 Message
0 missing_composer_json_file The "/vendor" directory using composer exists, but "composer.json" file is missing.
📁 assets/build/blocks/godam-gallery-v2/render.php (2 warnings)
📍 Line 🔖 Check 💬 Message
15 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$inner_block_video_ids".
23 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$inner_block_video_ids".
📁 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/08/21/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/08/21/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

Each Woo composite row carries revenue_minor/orders/currency from the
endpoint; assert groupRows maps them onto the sub, sums them onto the
parent (currency from a base-currency child), and a non-base order that
the server excluded (revenue_minor 0) is never blended in. Also assert
the fields default to 0/empty when the endpoint sends none.
@subodhr258

Copy link
Copy Markdown
Collaborator Author

Consolidated into the single Phase 2 secondary PR #2090 (all Woo Phase 2 core/UI work in one PR against feat/top-products). Closing this per-sub-task PR.

@subodhr258 subodhr258 closed this Aug 24, 2026
@subodhr258
subodhr258 deleted the feat/per-hotspot-revenue-ui branch August 24, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant