• Resolved wpuzman

    (@wpuzman)


    Hello. Is there any javascript events for AMP Stories. Like transition between slides, or slides end event?

    Like this:

    $('.mystory').on('slideChange', function() {
        // Do somthing.
    });
    
    $('.mystory').on('slideEnd', function() {
        // Stories end..
    });
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Luckyna San

    (@luckynasan)

    @wpuzman Thank you for reaching out with your topic. To confirm, are you inquiring about the specific line of event fired when the page transitions? Were you looking for this for the purpose of tracking in analytics?

    Every Web Story issues events as a user progresses through a story. For example, when a user progresses from one page to another within a story, the “story-page-visible” trigger fires every time a new page is loaded. The plugin is using storyPageIndex so you can see the page number in the reporting. Once you add your GA tracking ID, the plugin is automatically capturing the data and firing events.

    Thread Starter wpuzman

    (@wpuzman)

    Thank you for your reply. I will use in my own project, not for analytics. Is there any detailed documentation for the envets? And only story-page-visible event exist?

    Plugin Author Pascal Birchler

    (@swissspidy)

    > Is there any detailed documentation for the envets? And only story-page-visible event exist?

    Within the story itself, these events are only really exposed to amp-story-analytics. They are not custom events you can subscribe to using JS as custom JS is not allowed in stories.

    However, depending on your use case you might be interested in using <amp-story-player> instead which allows for programmatic control and subscribing to events using JS.

    Plugin Support Luckyna San

    (@luckynasan)

    @wpuzman We’ll close this topic as resolved, but feel free to open a new support topic if you have further questions. Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Events for Web Stories’ is closed to new replies.