Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
c8db500
feat(analytics): Top Products REST proxy with WooCommerce hydration
subodhr258 Aug 12, 2026
dca47f5
feat(dashboard): Top Products RTK endpoint + table component
subodhr258 Aug 12, 2026
3167e13
feat(dashboard): Woo-gated Top Products tab beside Top Videos
subodhr258 Aug 12, 2026
845889c
style(dashboard): segmented Top tabs + Source chips
subodhr258 Aug 12, 2026
4a1daa7
fix(dashboard): tabs in the table head, drop redundant title and the …
subodhr258 Aug 12, 2026
4bc995c
style(dashboard): match Figma tab switcher (dark active text, not acc…
subodhr258 Aug 12, 2026
0a0bba1
fix(dashboard): keep Revenue as an empty column (no 'Phase 2' text)
subodhr258 Aug 12, 2026
e4f1619
fix(top-products): translate the Product ID name fallback
subodhr258 Aug 12, 2026
6f046d3
feat(top-products): grey out in-video adds for products that can't be…
subodhr258 Aug 13, 2026
f647b40
feat(video-to-cart): dashboard Video-to-Cart card
subodhr258 Aug 14, 2026
c9aabf9
feat(video-to-cart): per-video Video-to-Cart card + share card location
subodhr258 Aug 14, 2026
cbceff9
test(video-to-cart): add data-test-id hooks to the VtC card
subodhr258 Aug 14, 2026
d7a9bc2
fix(video-to-cart): Woo-gate the card + hide it when the metric is un…
subodhr258 Aug 14, 2026
9ebe573
fix(analytics): per-video card sub-labels follow the range picker, no…
subodhr258 Aug 14, 2026
5a76a4a
test(top-products): CSV-injection guard, Video-to-Cart null-vs-zero, …
subodhr258 Aug 19, 2026
a8fe87f
fix(video-to-cart): stack the in-video / via-product-page split onto …
subodhr258 Aug 19, 2026
9c9e1f5
fix(dashboard): de-cramp Insights row + Video-to-Cart card polish
subodhr258 Aug 19, 2026
ff4409c
fix(video-to-cart): compact card - rate beside the count, split on on…
subodhr258 Aug 19, 2026
0747177
feat(top-products): make the product title a link to the product page
subodhr258 Aug 19, 2026
58c69d5
test(top-products): cover the Source chip label mapping
subodhr258 Aug 19, 2026
d0b2b35
Video to Cart card: show total + rate only, drop the direct/assisted …
subodhr258 Aug 19, 2026
3fae452
Gate Top Products + Video to Cart on the paid Woo add-on, not just Wo…
subodhr258 Aug 19, 2026
b78191e
Render actual revenue in TopProductsTable from analytics service (#2086)
mayan-000 Aug 20, 2026
6fa5422
feat(dashboard): single-currency Revenue KPI card + base_currency proxy
subodhr258 Aug 21, 2026
4dbbf5d
feat(analytics): show per-hotspot Direct revenue in the layer panel
subodhr258 Aug 21, 2026
f842135
test: per-hotspot revenue mapping in groupRows
subodhr258 Aug 21, 2026
2e8f155
feat(analytics): show Influenced revenue in Top Products (Sub-task D)
subodhr258 Aug 21, 2026
3e2a467
feat(analytics): per-video Revenue card on the single-video page (Sub…
subodhr258 Aug 24, 2026
49fbb06
fix(analytics): show 'No data' for a product with null revenue (F FIX 2)
subodhr258 Aug 24, 2026
964cf13
feat(analytics): show per-placement revenue split in Top Products (F …
subodhr258 Aug 24, 2026
335bede
feat(analytics): show comparative revenue tips on the per-video page …
subodhr258 Aug 24, 2026
ed96e90
feat(analytics): Video-to-Purchase card in the Insights rows
subodhr258 Aug 25, 2026
8833082
feat(analytics): per-video Purchase Funnel card
subodhr258 Aug 25, 2026
306df13
feat(analytics): redesign Purchase Funnel as Play to Cart to Purchase
subodhr258 Aug 25, 2026
a59f73a
feat(analytics): Funnel by placement card on the dashboard
subodhr258 Aug 25, 2026
6eb995d
fix(dashboard): surface proxy errors, currency-exact revenue, safe CS…
subodhr258 Aug 25, 2026
d1fff7c
fix(analytics-ui): correct funnel share label, defensive clamps, hone…
subodhr258 Aug 25, 2026
963ef06
style(analytics-ui): rename funnel to 'Purchase Funnel', add dashboar…
subodhr258 Aug 25, 2026
628851e
feat(analytics-ui): detailed Video-Attributed Revenue card
subodhr258 Aug 26, 2026
11f5f25
feat(analytics-ui): match VtC/VtP subtitle copy to the design
subodhr258 Aug 26, 2026
37272cc
feat(analytics-ui): trend badges on VtC/VtP/Revenue + own row for VtC…
subodhr258 Aug 26, 2026
880c256
feat(analytics-ui): Top Products i-icons + Direct/Assisted revenue split
subodhr258 Aug 26, 2026
4324e99
Merge remote-tracking branch 'origin/feat/top-products' into feat/pha…
subodhr258 Aug 26, 2026
0c81ae1
feat(analytics-ui): distinguish Video Woo Layer from Image Woo Layer …
subodhr258 Aug 26, 2026
9398a61
feat(analytics-ui): capture image-block hotspot interactions
subodhr258 Aug 26, 2026
ebe7331
fix(analytics-ui): image hotspot impressions + mixed-page block_source
subodhr258 Aug 26, 2026
ae30853
fix(analytics-ui): hide Video-Attributed Revenue card on null revenue…
subodhr258 Aug 27, 2026
bc9d806
fix(analytics-ui): capture-runtime tests + three display-correctness …
subodhr258 Aug 28, 2026
c143569
feat(analytics-ui): CSV export mirrors the Top Products table exactly
subodhr258 Aug 28, 2026
7bc912e
fix(analytics-ui): headline revenue equals Direct + Assisted when the…
subodhr258 Aug 28, 2026
81f8a53
docs(analytics-ui): note the Top Products sort params are reserved fo…
subodhr258 Aug 28, 2026
1f803e5
fix(analytics-ui): group thousands in Top Products order/reach counts
subodhr258 Aug 28, 2026
139c408
fix(analytics): require upload_files to read revenue-bearing analytic…
subodhr258 Aug 31, 2026
833f900
feat(analytics): add info tooltips to every Top Videos column
subodhr258 Sep 1, 2026
ae002b5
ci: run JS unit tests on feat/** pull requests
subodhr258 Sep 1, 2026
ca4e224
Merge pull request #2090 from rtCamp/feat/phase2-woo-analytics-ui
subodhr258 Sep 2, 2026
c5bd3f6
feat(dashboard): GA4 connection widget (#2097)
mayan-000 Sep 7, 2026
b7aec61
Dashboard: use toggle buttons for Top tabs and restore Engagement Rat…
subodhr258 Sep 8, 2026
9495fbd
Top Products: harden CSV escaping and distinguish load error from empty
subodhr258 Sep 8, 2026
cc0fbe9
Top Videos: harden CSV escaping for LF and CR
subodhr258 Sep 8, 2026
01f633b
PlacementFunnelCard: surface a hard query error, not just the soft shape
subodhr258 Sep 8, 2026
63b826a
RevenueCard: gate the split bar and Direct/Assisted labels on hasSplit
subodhr258 Sep 8, 2026
0f426c5
VideoToPurchaseCard: label the count as purchasers, not orders
subodhr258 Sep 8, 2026
b4122ad
Analytics proxy: validate placement-funnels range and reject 200-with…
subodhr258 Sep 8, 2026
db518ae
Merge remote-tracking branch 'origin/develop' into fix/pr2074-review-…
subodhr258 Sep 8, 2026
38754f4
test: cover proxy non-2xx/400 error paths and TopProductsTable error …
subodhr258 Sep 8, 2026
82b23d7
fix(dashboard): surface range-query errors in-place instead of vanish…
subodhr258 Sep 8, 2026
ad2fde7
fix(dashboard): harden Top Videos export, error state, chart tooltip,…
subodhr258 Sep 9, 2026
a8d8878
feat(dashboard): restore per-card date-range pickers, reconciled with…
subodhr258 Sep 9, 2026
71a3d16
fix(dashboard): surface per-card HARD query errors; Top Products base…
subodhr258 Sep 9, 2026
6c51230
Merge remote-tracking branch 'origin/develop' into godam-2074-sync
subodhr258 Sep 9, 2026
ce5e507
i18n: regenerate godam.pot to match a fresh prod build (#2074)
subodhr258 Sep 9, 2026
c8a2505
Merge branch 'develop' into feat/top-products (sync #2074 with latest…
subodhr258 Sep 14, 2026
46fd85c
feat(dashboard): add "Show deleted products" toggle to Top Products
subodhr258 Sep 15, 2026
8787f3a
feat(analytics): add date-range picker to single-video Revenue and Pu…
subodhr258 Sep 15, 2026
e960974
fix(analytics): correct Video-to-Cart subtitle wording
subodhr258 Sep 15, 2026
e6314b7
feat(analytics): rename the layer-interaction metric from Conversion …
subodhr258 Sep 15, 2026
0595c18
fix(analytics): label GA4 widget counts as events
subodhr258 Sep 15, 2026
dcfcd9f
fix(analytics): rename single-video Placements 'Views' to 'Unique Views'
subodhr258 Sep 15, 2026
e8f42ef
fix(analytics): note distinct-visitor basis on Funnel by placement
subodhr258 Sep 15, 2026
5a84b09
fix(analytics): keep layer funnel in the wide column beside the rail
subodhr258 Sep 15, 2026
b1fe3e4
fix(analytics): move per-hotspot revenue to a tooltip so the name fits
subodhr258 Sep 15, 2026
3a4ea71
fix(analytics): flush Top Products/Top Videos id caches on content ch…
subodhr258 Sep 15, 2026
123bf62
fix(dashboard): bracket the faded rate next to Top Products counts
subodhr258 Sep 15, 2026
3b2b11a
fix(analytics): label the Placements plays stat "Total Plays"
subodhr258 Sep 15, 2026
dd1d731
fix(analytics): show "<1%" for sub-1% countries in Views by Location
subodhr258 Sep 15, 2026
853fa7d
fix(analytics): drop the redundant single-video date pickers
subodhr258 Sep 15, 2026
1c7a999
fix(analytics): send single-video Back to the Dashboard when entered …
subodhr258 Sep 15, 2026
17b3bbd
fix(analytics): consistent default range and preset labels
subodhr258 Sep 15, 2026
e12e2b5
fix(analytics): fix Playback Performance tooltip colours, order, date…
subodhr258 Sep 15, 2026
703c982
fix(analytics): focus the active preset when the range menu opens
subodhr258 Sep 15, 2026
79a3906
feat(analytics): give single-video Revenue and Purchase Funnel their …
subodhr258 Sep 16, 2026
21fefad
fix(dashboard): vertically centre the GA4 status tooltip icon
subodhr258 Sep 16, 2026
2e7377a
fix(analytics): label Video-to-Purchase rate 'unique viewers who played'
subodhr258 Sep 16, 2026
d94740d
Merge branch 'develop' into feat/top-products
subodhr258 Sep 16, 2026
52e135f
fix(analytics): silence attachment-lookup coverage false-positive in …
subodhr258 Sep 16, 2026
545e17f
test(analytics): match Video-to-Cart card test to shipped subtitle copy
subodhr258 Sep 17, 2026
f40f84f
i18n: regenerate godam.pot for Top Products + Video-to-Cart + revenue…
subodhr258 Sep 17, 2026
e179a9e
Merge branch 'develop' into feat/top-products
subodhr258 Sep 17, 2026
c01b21c
i18n: regenerate godam.pot after develop merge
subodhr258 Sep 17, 2026
d5348b9
i18n: keep godam.pot aligned with develop (regenerate at release, not…
subodhr258 Sep 17, 2026
067bbf1
chore: prep v2.3.0 (version bump + changelog)
subodhr258 Sep 18, 2026
f5a7ba7
fix(analytics): funnel hover tooltips, Purchased tier split, docs lin…
subodhr258 Sep 18, 2026
84a9cb4
fix(dashboard): show full Top Videos / Top Products titles in a WP To…
subodhr258 Sep 18, 2026
fbbe1a1
fix(dashboard): use a native title tooltip for truncated Top Videos /…
subodhr258 Sep 18, 2026
3e9ad29
fix(dashboard): decode HTML entities in Top Videos / Top Products titles
subodhr258 Sep 18, 2026
de02d2d
fix(analytics): decode img alt entities; drop zero-count funnel segments
subodhr258 Sep 21, 2026
674beb6
fix(analytics): funnel hover tooltips, Purchased tier split, docs lin…
subodhr258 Sep 21, 2026
0958f1d
fix(analytics): create window.analytics on image-only pages
subodhr258 Sep 24, 2026
b5205ce
fix(analytics): look up Top Products outside the media-site switch
subodhr258 Sep 24, 2026
b96faa2
docs: correct the v2.3.0 changelog and restore the v2.2.4 entry (#2140)
joelabreo227 Sep 24, 2026
88f1ba5
fix: correct 2.3.0 copy and two broken godam.io links (#2141)
joelabreo227 Sep 24, 2026
5c11b72
fix(analytics): create no visitor id on pages that send no analytics
subodhr258 Sep 24, 2026
1b3ead3
fix(analytics): visitor id on image-only pages so in-image sales earn…
subodhr258 Sep 24, 2026
4a2da36
Merge branch 'develop' into feat/top-products
subodhr258 Sep 24, 2026
644f20b
test: one set of HTTP stubs for PHPUnit, pin the Jest locale to en_US
subodhr258 Sep 24, 2026
6327b73
chore: regenerate languages/godam.pot after the develop merge
subodhr258 Sep 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/js_unit_tests_on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
branches:
- develop
- main
- 'feat/**'

name: JS Unit Tests

Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog #

## v2.3.0 (September 24, 2026) ##

- Feat: Revenue Analytics for WooCommerce. See how much order value is credited to each video, split into Direct (added to cart inside the video) and Assisted (clicked the product in a video, image hotspot or Reel Pop, then added it to cart on its product page). Influenced revenue is reported separately and is never added to the headline.
- Feat: Top Products, a new dashboard tab showing per-product views, add-to-cart counts split into in-video and product-page, revenue, and where in your videos each product appeared.
- Feat: Video to Cart and Video to Purchase rates, measured against the people who actually played the video.
- Feat: Two new funnels: Play to Cart to Purchase, and the same funnel broken down by placement.
- Feat: Per-hotspot revenue in layer analytics, showing the revenue from in-video add-to-carts made through each product hotspot.
- Feat: A Google Analytics 4 status widget on the analytics dashboard, showing whether GoDAM for Woo is pushing video-driven add_to_cart and purchase events to your Google Tag Manager dataLayer.
- Tweak: The Revenue and Purchase Funnel cards on the single-video page each have their own date-range picker.
- Tweak: The layer interaction metric is now called "Interaction rate" instead of "Conversion".
- Note: Revenue and product metrics need the GoDAM for Woo add-on 2.2.0 or later.

## v2.2.4 (September 21, 2026) ##

- Chore: Security fixes.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Tested up to: 7.1

Requires PHP: 7.4

Stable tag: 2.2.4
Stable tag: 2.3.0

License: [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html)

Expand Down Expand Up @@ -108,7 +108,7 @@ WordPress native video hosting solution, perfect for creators, marketing teams,
#### 📌 Advanced Video Analytics [Paid]
- Get first-party video insights to understand viewer behavior, make data-driven decisions, and refine your content strategy.
- Play rate, watch time, engagement
- Heatmaps to understand dropoffs
- Viewer retention curve to see where viewers drop off
- Geo-based traffic data
- Performance comparison

Expand Down Expand Up @@ -155,7 +155,7 @@ GoDAM works seamlessly with popular WordPress plugins to enhance interactivity a
### Pricing Plans
[View Pricing Plans](https://godam.io/pricing?utm_campaign=plugin-readme&utm_source=wordpress-org&utm_medium=plugin&utm_content=pricing-link)

- **30-day Free Trial** with all features included
- **60-day Free Trial** with all features included
- **Flexible pricing** options to suit different needs.
- **Upgrade or cancel anytime** based on usage.

Expand Down Expand Up @@ -208,10 +208,10 @@ Adaptive bitrate streaming ensures that viewers get the best possible video qual
Yes, our customizable player allows you to tailor the controls, branding, and features to match your unique requirements and branding guidelines.

### 7. Is there a free trial available?
Yes! You can start with a 7-day free trial to explore all features. If you decide not to continue with the subscribed plan, you can cancel anytime and remove your credit card.
Yes! You can start with a 60-day free trial to explore all features. No credit card is required, and you can cancel anytime.

### 8. Can I track video engagement and analytics?
Yes, GoDAM provides robust analytics tools to track video engagement, including metrics like play counts, watch time, and heatmaps to see which parts of your videos are most engaging. These insights help you optimize your content strategy.
Yes, GoDAM provides robust analytics tools to track video engagement, including metrics like play counts, watch time, and a viewer retention curve that shows where viewers drop off. These insights help you optimize your content strategy.

### Screenshots

Expand Down
48 changes: 36 additions & 12 deletions assets/src/blocks/godam-image/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,36 @@

$godam_has_layers = ! empty( $godam_layers );

// Enqueue the shared image-layers front-end renderer (+ hotspot styles) only
// when there are layers to draw. Registered lazily here as footer scripts, so
// the Woo add-on's `godam_image_layers_frontend_dependencies` hook (added on
// Enqueue the shared image-layers front-end renderer (+ its analytics runtime)
// only when there are layers to draw. Registered lazily here as footer scripts,
// so the Woo add-on's `godam_image_layers_frontend_dependencies` hook (added on
// wp_enqueue_scripts) is already in place.
if ( $godam_has_layers ) {
// Layer-analytics runtime: registers `window.GoDAM.addLayerInteraction` + the
// page-hide flush WITHOUT the video player (image pages never load
// `godam-player-analytics.min.js`). Without it every emit in the shared hotspot
// managers is a guarded no-op. Registered FIRST and made a DEPENDENCY of the
// renderer below, so `window.GoDAM` exists before the renderer's DOMContentLoaded
// handler fires the parent-layer 'viewed' impression beacon on render.
$godam_la_asset_path = RTGODAM_PATH . 'assets/build/js/godam-layer-analytics.min.asset.php';
$godam_la_asset = file_exists( $godam_la_asset_path )
// phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable -- file path is a plugin constant + hardcoded build filename.
? include $godam_la_asset_path
: array(
'dependencies' => array(),
'version' => RTGODAM_VERSION,
);

if ( ! wp_script_is( 'godam-layer-analytics-script', 'registered' ) ) {
wp_register_script(
'godam-layer-analytics-script',
RTGODAM_URL . 'assets/build/js/godam-layer-analytics.min.js',
$godam_la_asset['dependencies'],
$godam_la_asset['version'],
true
);
}

$godam_img_asset_path = RTGODAM_PATH . 'assets/build/js/godam-image-layers-frontend.min.asset.php';
$godam_img_asset = file_exists( $godam_img_asset_path )
// phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable -- file path is a plugin constant + hardcoded build filename.
Expand All @@ -102,7 +127,10 @@
);

if ( ! wp_script_is( 'godam-image-layers-frontend', 'registered' ) ) {
$godam_img_deps = apply_filters( 'godam_image_layers_frontend_dependencies', $godam_img_asset['dependencies'] );
// Depend on the analytics runtime so `window.GoDAM.addLayerInteraction` is
// registered before the renderer runs and fires the 'viewed' beacon.
$godam_img_deps = apply_filters( 'godam_image_layers_frontend_dependencies', $godam_img_asset['dependencies'] );
$godam_img_deps[] = 'godam-layer-analytics-script';
wp_register_script(
'godam-image-layers-frontend',
RTGODAM_URL . 'assets/build/js/godam-image-layers-frontend.min.js',
Expand All @@ -112,20 +140,15 @@
);
}

// Enqueue the runtime explicitly too (in case the renderer was pre-registered
// without the dependency), then the renderer, which pulls the runtime first.
wp_enqueue_script( 'godam-layer-analytics-script' );
wp_enqueue_script( 'godam-image-layers-frontend' );

// The hotspot stylesheet (`godam-player-style`) is tied to this block via
// wp_enqueue_block_style() in class-blocks.php, so WordPress prints it
// whenever the block renders (reliable on block themes / FSE, unlike a late
// wp_enqueue_style() here), so nothing else needs enqueuing here.
//
// Analytics is intentionally NOT enqueued for images: they have no analytics
// view (`image` capability sets `showStats: false`) and no transcoding job,
// so a beacon per hotspot interaction would only collect data nothing
// consumes. Without `godam-player-analytics-script`,
// `window.GoDAM.addLayerInteraction` is absent, so every emit in the shared
// managers / frontend.js is a guarded no-op. Re-enable here when an image
// analytics view ships.
}

$godam_instance_id = 'img_' . bin2hex( random_bytes( 8 ) );
Expand Down Expand Up @@ -157,6 +180,7 @@ class="godam-image__frame"
<?php if ( $godam_has_layers ) : ?>
data-id="<?php echo esc_attr( (string) $godam_attachment_id ); ?>"
data-instance-id="<?php echo esc_attr( $godam_instance_id ); ?>"
data-block-source="godam-image"
data-godam-image-layers="<?php echo esc_attr( wp_json_encode( $godam_layers ) ); ?>"
<?php endif; ?>
>
Expand Down
17 changes: 14 additions & 3 deletions assets/src/js/godam-image-layers/render-image-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,11 @@ export function initImageFrame( frame ) {
hotspotManager.computeContentRect = () => adapter.computeContentRect();
hotspotManager.setupHotspotLayer( mergedLayer, hotspotGroup );
const layerObj = hotspotManager.hotspotLayers[ hotspotManager.hotspotLayers.length - 1 ];
// No analytics on images (see godam-image/render.php): the block does
// not load the analytics buffer, so the managers' interaction emits are
// guarded no-ops — there is no `viewed` beacon to fire here.
// The analytics runtime is loaded on image pages now (see
// godam-image/render.php), so plain-hotspot interaction emits are
// captured like on video. Commerce impressions (Top Products) come from
// the Woo layer's parent 'viewed' below; a plain hotspot has no product
// row, so no impression beacon is fired here.
hotspotManager.createHotspots( layerObj );
}

Expand Down Expand Up @@ -230,6 +232,15 @@ export function initImageFrame( frame ) {
wooManager.setupLayer( layer, layerEl );
const layerObj = wooManager.wooLayers[ wooManager.wooLayers.length - 1 ];
wooManager.createProductHotspots( layerObj );
// A still image has no play/visibility transition, so fire the
// parent-layer 'viewed' impression beacon once, now, on render.
// This is the impressions signal the product rollup reads; without
// it image Woo hotspots would always show 0 impressions. Guarded
// no-op until the analytics runtime is loaded (it is a dependency
// of this script, so it is present by now).
if ( typeof wooManager.emitLayerVisible === 'function' ) {
wooManager.emitLayerVisible( layerObj.layer );
Comment on lines +235 to +242

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping the on-render emit for this release. It is deliberate: a still image has no play or visibility transition to hang the impression on. Your point stands that an image below the fold or in a hidden tab still counts an impression, which loosens the CTR and add-to-cart denominator versus the video path (which emits on playback reaching the layer). Gating the emit behind an IntersectionObserver (emit once on first intersection, disconnect on teardown) is a tracked follow-up, not this release.

}
} );
}
}
Expand Down
11 changes: 9 additions & 2 deletions assets/src/js/godam-player/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,15 @@ function observePageLoadForVideo( video ) {
( function() {
function findVideoElementById( videoId, root ) {
const ctx = root && root.querySelector ? root : document;
return ctx.querySelector(
`.easydam-player.video-js[data-id="${ videoId }"], .video-js[data-id="${ videoId }"]`,
// Image-block hotspot frames carry the same data-id (attachment id) but are
// not `.video-js`. The fallback lets the layer flush find an image frame and
// read its `data-block-source` ('godam-image'), so on a page that has BOTH a
// video and an image the tag is not dropped to ''. Attachment ids are unique,
// so a video and an image never share one; the video match always wins first.
return (
ctx.querySelector(
`.easydam-player.video-js[data-id="${ videoId }"], .video-js[data-id="${ videoId }"]`,
) || ctx.querySelector( `.godam-image__frame[data-id="${ videoId }"]` )
);
}
window.GoDAM = window.GoDAM || {};
Expand Down
Loading
Loading