amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Story Player: Analytics events do not always fire when moving backwards

Open philipjohn opened this issue 4 months ago • 1 comments

Description

Bug Description

When navigating backwards between Stories in a Story Player, analytics events are not always firing. In a carousel with more than two Stories, navigating forwards between Stories triggers the events as expected. When you hit the back button to move to the previous Story though, the events do not fire, but only that one time. Subsequent clicks on the back navigation button do trigger events.

Expected Behaviour

When moving between Stories within a Story Player, GA events should always fire.

Additional Context

The only previous issue I found was this bug which sounds very similar but was identified and fixed years ago.

Reproduction Steps

This was using the Web Stories WP plugin in a fresh local development environment.

See video below for a demonstration of these steps.

  1. Add a GA4 tracking ID to WP Admin > Web Stories > Settings
  2. Set the default advancement mode to Manual
  3. Create four Stories
  4. Add the Web Stories block to a post, choosing Latest Stories and Box Carousel. Or paste in <!-- wp:web-stories/embed {"blockType":"latest-stories","viewType":"carousel","fieldState":{"show_title":true,"show_author":false,"show_date":false,"show_image_alignment":false,"show_excerpt":false,"show_sharp_corners":false,"show_archive_link":true,"show_circle_size":false,"show_number_of_columns":false}} /-->
  5. Save the post and view
  6. Open the GA4 Debugger extension to monitor events
  7. Click on the first Story in the Carousel and observe the Page View and Custom Event appear in the debugger
  8. Click on the arrow to skip to the second Story and observe the Page View and Custom Event appear in the debugger
  9. Click on the arrow to skip to the third Story and observe the Page View and Custom Event appear in the debugger
  10. Click on the arrow to skip to the fourth (and last) Story and observe the Page View and Custom Event appear in the debugger
  11. Click on the arrow to go back to the third Story and observe that no GA events fire
  12. Click on the arrow to go back to the second Story and observe the Page View and Custom Event appear in the debugger
  13. Click on the arrow to go back to the first Story and observe the Page View and Custom Event appear in the debugger

https://github.com/user-attachments/assets/6196114e-501b-446d-b5d4-05d07a9df972

Relevant Logs


Browser(s) Affected

Chrome

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

No response

philipjohn avatar Aug 15 '25 17:08 philipjohn