Sending Events

This guide shows you how to send the Storyly events to specific data platforms. You can use the following function of StorylyDelegate to redirect the Storyly events to your data platform:

func storylyEvent(_ storylyView: Storyly.StorylyView,
                  event: Storyly.StorylyEvent,
                  storyGroup: Storyly.StoryGroup?,
                  story: Storyly.Story?,
                  storyComponent: Storyly.StoryComponent?) {}
- (void)storylyEvent:(StorylyView *)storylyView
               event:(enum StorylyEvent)event
          storyGroup:(StoryGroup *)storyGroup
               story:(Story *)story
      storyComponent:(StoryComponent *)storyComponent {}

📘

Tip

You can also check Storyly Events

📘

Tip

You can send and track Storyly Events to Google Analytics. You can find the recipe below that Sending Storyly Events to GA4.

Storyly Events

This section shows you how to observe Storyly's basic functionality events. In order to get notification about these basic events, you should override the following function in StorylyDelegate, which you have registered in Initial SDK Setup.

📘

Tip

You can also check Storyly Events

StorylyStoryPresented Event

This event will let you know that stories are starting to be presented to the users. In order to notified about this event, use the following example:

func storylyStoryPresented(_ storylyView: Storyly.StorylyView) {}
- (void)storylyStoryPresented:(StorylyView *)storylyView {}

StorylyStoryDismissed Event

This event will let you know that the user dismissed the current story while watching it. In order to notified about this event, use the following example:

func storylyStoryDismissed(_ storylyView: Storyly.StorylyView) {}
- (void)storylyStoryDismissed:(StorylyView *)storylyView {}

Interactive Events with Tracking ID

This guide shows you how to get reactions of users from specific interactive components. You can use the following function to get reactions of your users:

func storylyUserInteracted(_ storylyView: Storyly.StorylyView,
                           storyGroup: Storyly.StoryGroup,
                           story: Storyly.Story,
                           storyComponent: Storyly.StoryComponent) {}
- (void)storylyUserInteracted:(StorylyView *)storylyView
                   storyGroup:(StoryGroup *)storyGroup
                        story:(Story *)story
               storyComponent:(StoryComponent *)storyComponent {}

StoryComponent parameter informs your application about the interacted component and the details of the interaction. For instance, if a user answers a quiz, the payload will include what the right answer is and what the user's answer is. The structure of StoryComponent is different for each of the interactive components.

🚧

Warning

This event only notifies your application about Emoji, Rating, Poll, Quiz, and Countdown reactions.

Tracking ID

From Storyly Studio, application owners can give tracking ids to the interactive components. This id can be received using the customPayload field of StoryComponent.