Listen to Analytics

📘

Analytics page

All analytics events are automatically sent to our servers. You can find various statistics and analysis of your widgets on your Analytics page on Studio.

You can also retrieve them for your own analytics. There are several ways to listen to analytics events depending on the way you integrated your widget.

Default integration

After integrating the widget on your website page, you can listen to JOIN_ANALYTICS global event like this :

document.addEventListener("JOIN_ANALYTICS", function(event) {
	// analytics payload is available in `detail` field of the event.
  console.log(event.detail.cpWidgetAlias)
})

See native documentation for more informations about native event listeners.

See Easy integration without npm (recommended) for more informations.

Standalone widget

When instanciating the standalone widget, you can pass a function that will be called each time an event is triggered. Like this:

function analyticsCallback(payload) {
  // Do something with the payload...
  console.log(payload.cpWidgetAlias)
}
const customPlayer = new JoinModalPlayer('my-widget', { analyticsCallback })

See Standalone Widget for more informations.

NPM Package

When calling renderListBubble, you can pass a function that will be called each time an event is triggered. Like this:

function analyticsCallback(payload) {
  // Do something with the payload...
  console.log(payload.cpWidgetAlias)
}

renderBubbleList(
  "uniqueDivId",
  "teamId",
  "aliasWidget",
  { analyticsCallback },
);

See NPM Package for more informations on how to use it.


Analytics events

During its life on a website (or mobile), a widget can trigger various analytics events. There are events related to the widget itself and events related to the stories inside of it. They track how the users interact with the widget and its content.

Analytics v2

A new Analytics stack has been implemented. Old events have been renamed, with more properties. New events have been added. They are split by categories. Each category has its own properties.

Category : Story

Event NameTrigger Scenario
story-chapter-viewA chapter of the story become active: Opening a player, Change of story (swipe,…), Change of chapter, Coming back to a tab with a story opened ...
story-first-chapter-viewThe first chapter of the story becomes active.
story-last-chapter-viewThe last chapter of the story becomes active.
story-chapter-exitThe active chapter exits either manually or automatically.
story-viewA story become active: Opening a player, Change of story (swipe,…), Coming back to a tab with a story opened ...
story-exitThe active story exits, either manually or automatically.
story-completedThe last chapter of the story is fully read or ends due to a tap to next.
story-tap-nextUser taps to next on a story.
story-tap-previousUser taps to previous on a story.
story-swipe-nextUser swipes to the right or clicks on the next story button.
story-swipe-previousUser swipes to the left or clicks on the previous story button.
story-pauseLong press on mobile or on click of the pause button on desktop.
story-unpauseLong press is released on mobile or on click of the play button on desktop.
story-muteClick on mute button.
story-unmuteClick on unmute button.

Category : Interaction

Event NameTrigger Scenario
interaction-viewAn interaction becomes active (displayed/viewed) in an active story.
interaction-completedUser completes an interaction. It must be triggered only once.
interaction-engageUser executes an action on an interaction (e.g., form -> fill fields, tooltip click, CTA click).
interaction-exitThe interaction becomes inactive (from an active state).

Category : Widget

Event NameTrigger Scenario
widget-initializedThe widget has finished initialization before loading data. In case of changing audiences, it is not re-initialized.
widget-data-loadedThe widget loads data (from internal JSON, API fetch, cache, or fallback).
widget-displayedThe widget is inserted in the page and displayed or ready to be displayed.
widget-thumbnail-readyAll thumbnails of visible elements of the widget are loaded.
widget-view-50At least 50% of the widget’s height is visible (in the viewport and not obstructed by another element on top of it).
widget-view-75At least 75% of the widget’s height is visible(in the viewport and not obstructed by another element on top of it).
widget-view-100100% of the widget’s height is visible (in the viewport and not obstructed by another element on top of it).
widget-clickUser clicks on a widget.
widget-player-closeThe player is closed (e.g., swipe down, tap next when no story, or programmatically).
widget-scrolledUser scrolls (mobile) or clicks on an arrow (desktop) to see next stories.
widget-closeThe widget is closed in certain cases (e.g., sticky widget).

Category : Product

Event NameTrigger Scenario
product-loadedProduct has been loaded in shopping interaction
product-viewProduct has been seen by user
product-details-viewProduct details panel has been seen by user
product-engageUser has engaged with product (click, add to cart, redirect to product page)

Category : External

Event NameTrigger Scenario
page-loadedWebsite page is loaded.
User arrived on the website but the content is not visible yet.
page-viewWebsite page is viewed.
Everything is done loading, user can browse the website
page-exitUser exited the website. It can also be triggered when user changes tab in his browser.
product-add-to-cartA product is added to cart either from the website or from a story directly
cart-sellTriggered at sell confirmation
product-sellTriggered at sell confirmation for each product in the cart
page-engageTriggered when a visitor of a webpage engages with the page (click or others actions)

Properties

All events have at least the common properties. Each category has its own properties.

Common properties

NameTypeDescription
event_idstringEvent technical Id
event_categorystringstory, widget, product, …
event_typestringEvent name. See above for a list of event names
event_versionstringEvent analytics version. (Should be v2)
event_date_timezonenumberTimezone of the visitor triggering the event. Number in minutes from UTC
event_date_creationtimestampTimestamp (in s) the event was created client side.
event_ownerstringJOIN owner
event_user_idstringAnonymous user id to monitor sessions
event_device_screen_widthnumber
event_device_screen_heightnumber
event_device_screen_colornumber
event_device_screen_rationumber
event_device_pixel_rationumber
event_device_network_typestringWi-Fi, cellular, bluetooth, ethernet, unknown
event_device_network_effective_typestringWi-Fi, 4G, 5G, Ethernet, unknown
event_device_orientationstringportrait, landscape
event_device_battery_levelnumberbattery level. Between 0 and 1
event_integration_environmentstringapp, web, other, unknown
event_integration_location_namestringContains both url or app information
event_integration_web_protocolstring
event_integration_web_titlestring
event_integration_web_base_urlstringURL that only contains protocol+domain+path
event_integration_web_urlstring
event_integration_web_domainstring
event_integration_web_pathstring
event_integration_web_parametersstring
event_integration_web_anchorstring
event_integration_web_referrerstring
event_integration_web_percent_scrollednumberRatio of page scrolled when the event was triggered. between 0 and 1.
event_integration_web_browser_namestringBrowser name
event_integration_web_browser_versionstringBrowser version
event_integration_web_browser_languagestringBrowser preferred language
event_integration_web_browser_language_localestring
event_integration_web_browser_viewport_widthnumberbrowser's viewport width (in px)
event_integration_web_browser_viewport_heightnumberbrowser's viewport height (in px)
event_page_tagstringPage load ID reset on each new page reload

Story properties

NameTypeDescription
story_idstringStory technical id
story_titlestringStory's title
story_labelstringStory's displayed label (may be different from title)
story_last_published_datetimestampLast published date of the story
story_has_subtitlesbooleanWether story has subtitles or not
story_has_interactionsbooleanWether story has interactions or not
story_has_soundbooleanIf at least one chapter has sound on a story, then yes
story_chapter_countnumberTotal count of chapters
story_interaction_countnumberTotal count of interactions on the story
story_durationnumberTotal duration of a story (in ms)
story_chapter_indexnumberThe index of the chapter responsible for sending the event. Indexes start at 0
story_chapter_durationnumberTotal duration of the chapter
story_previous_chapter_indexnumberThe index of the previous chapter
story_index_in_widgetnumberIndex of the story in the list of stories. Indexes start at 0.
story_mutedbooleanIs Story muted by the user
story_displayed_formatstringmobile/ desktop - We can have a mobile format for displaying a story even on desktop (ex: sticky)
story_completionnumberRatio of completion between 0 and 1
story_chapter_completionnumberRatio of completion between 0 and 1
story_viewing_timenumberDuration in ms
story_chapter_viewing_timenumberDuration in ms
story_is_activebooleanProperty that should always be true for now, but can be used to dissociate events in the future
story_chapter_is_activebooleanProperty that should always be true for now, but can be used to dissociate events in the future
story_exit_reasonstringEnum: swipeDown, swipeNext, swipePrevious, tapNext, tapPrevious, closeButton, ctaClick, autoAdvance
story_chapter_exit_reasonstringEnum: swipeDown, swipeNext, swipePrevious, tapNext, tapPrevious, closeButton, ctaClick, autoAdvance
story_pause_durationnumberDuration in ms
story_versionstringStory's technical version.

Interaction properties

NameTypeDescription
interaction_idstringInteraction technical Id
interaction_typestringInteraction type (CTA, Quiz, Shopping, ...)
interaction_engage_typestringredirectform-input-focus| form-input-changeform-submit| poll-clicked| quiz-click | open-product-config| continue-shopping
interaction_engage_value_1stringFirst generic value
interaction_engage_value_2stringSecond generic value
interaction_engage_urlstringOnly used in case of CTA (replacing value 1-2)
interaction_engage_labelstringOnly used in case of CTA (replacing value 1-2)
interaction_engaging_timenumberTime between first interactionEngage and interactionEngageComplete or interactionExit
interaction_viewing_timenumberTime between interactionView and interactionExit
interaction_has_been_blockingbooleanIn case the interaction has blocked the auto-advance in the chapter/story, waiting for an engagement
interaction_is_already_completedbooleantrue if it was already completed when the interaction became active
interaction_is_first_engagebooleaninteraction-engage event is the first engagement of the page.
interaction_is_story_first_engagebooleaninteraction-engage event is the first engagement of the story.
interaction_is_completion_engagebooleanThe event is the one that has completed the interaction.
interaction_exit_statestringcompleted |
canceled: engaged at least once |
ignored: exited interaction without engage |
already-completed

Widget properties

NameTypeDescription
widget_idstringWidget technical id
widget_aliasstringWidget alias
widget_typestringWidget type (list, sdk, qr-code, link)
widget_shapestring(Only applies for type list) Widget shape (bubble, card, square)
widget_layoutstringWidget layout (list, solo-sticky, none)
widget_integration_typestringsnippet, npm, sdk, generic, shopifyPlugin, …
widget_integration_relative_positionnumberRatio between the widget position on the page and the page height. Between 0 and 1.
widget_integration_positionnumberPosition from the top of the page (in px)
widget_story_countnumberNumber of stories in the widget, after widget-data-loaded (with audience conditions applied)
widget_duration_displayednumberDuration (in ms) since widget is displayed, starting at widget_display event
widget_click_countnumberNumber of clicks on the widget since it has been displayed, also to set for all story events
widget_player_close_reasonstringclose-button | background | auto-advance | swipe-down| tap-next
widget_close_reasonstringclose reason (manual or auto)
widget_versionstringWidget version
widget_audience_slots_matchedarrayFor every widget event except widget initialized, and also for stories when available
widget_page_scroll_occurredbooleanPermits to know if the user has scrolled on the page before an event
widget_visible_duration_thresholdnumberUsed in the event widgetView100Extended, to know the threshold of visibility
widget_is_scrollablebooleanAccording to integration, if the widget is too large to be displayed fully and is made scrollable
widget_scroll_typestringnatural/button – to know in case of widgetScroll event, if the scroll is from button or natural gesture
widget_data_loading_timenumberDuration of the data loading (from API) if instant if coming from JSON = null
widget_data_loaded_sourcestringThe source from where the data has been loaded (from API, embedded-data, cache, fallback, ...)
widget_video_cover_countnumberCount of the number of video covers
widget_static_cover_countnumberCount of the number of static covers
widget_element_heightnumberHeight of the widget (element not full bloc) configured in the studio (or in app) in px

Product properties

NameTypeDescription
product_idstringID of the product variation
product_namestringProduct name
product_image_urlstringProduct image url
product_thumbnail_urlstringProduct thumbnail url
product_variantstringProduct variant
product_engage_typestring
product_engage_value_1stringFirst generic value
product_engage_value_2stringSecond generic value
product_engage_urlstringURL that the product CTA redirects to
product_engage_labelstringLabel of the CTA used
product_is_first_engagebooleanproduct-engage event is the first engagement.
product_is_completion_engagebooleanThe event is the one that has completed the product interaction
product_pricenumberProduct price
product_base_pricenumberProduct base price
product_final_pricenumberProduct final price
product_quantitynumberProduct quantity

External properties

ℹ️ Event product-add-to-cart has all product properties. See above for the list.

NameTypeDescription
page_engage_typeclick | scrollwhen page-engageis triggered.
Type of user engagement.
page_viewing_timenumberwhen page-exit is triggered.
time (in ms) user spent on the page.
transaction_idstringwhen cart-sell is triggered.
unique id to identify product sell
total_base_amountnumberwhen cart-sell is triggered.
total amount of cart.
total_final_amountnumberwhen cart-sell is triggered.
total amount of cart after discount or other.
product_countnumberwhen cart-sell is triggered.
number of products in the cart
product_idsstring[]when cart-sell is triggered.
List of product ids
currencystringwhen cart-sell is triggered.
currency of the cart products

Analytics v1 (Legacy)

❗️

Deprecation notice

v1 events are considered deprecated and will be removed in the future. Don't use them for your new developments.

Check name in V2 column to see how to find old events in new Analytics.

List of event types

Here the list of all available events. There are 2 types of events with different payloads.

EventTypeType of payloadDescriptionname in V2
widgetMountedwidgetTriggers when the widget is mounted.widget-initialized
storiesFetchedwidgetTriggers when the stories are fetched.widget-data-loaded
componentVisible50widgetTriggers when the widget is 50% visible.widget-view-50
componentVisible75widgetTriggers when the widget is 75% visible.widget-view-75
firstClickOnWidgetwidgetTriggers the first time a story is opened (with a click on a widget) during a visit on a page.widget-click (with property widget_click_count = 1)
additionalClickOnWidgetwidgetTriggers every other times a story is opened during a visit on a page.widget-click (with property widget_click_count > 1)
closedwidgetTriggers when a sticky widget is closed.widget-close
storyPageVisiblestoryTriggers when the current story changes page.story-view
storyLastPageVisiblestoryTriggers when the last page of a story is viewed.story-last-chapter-view
storyClickOnCallToActionstoryTriggers when a cta button is clicked in a story.interaction-engage (with property engage-type= 'cta')
storyClickOnLinkInPagestoryTriggers when a link is clicked inside a shopping interaction.interaction-engage (with property engage-type= 'shopping')

Widget Event payload

The widget events share the following payload:

NameTypeDescription
eventTypestringEvent's type. See up for the full list.
eventOwnerstringJOIN identifier of the customer.
cpWidgetAliasstringalias of the widget.
cpWidgetTypestringwidget's type.
cpWidgetVersionstringwidget's version.
eventWidgetWorkspacesstring[]legacy information. For newer client, it should always be ["ws_default"].
datenumberevent's time.
eventCategorywidgetevent was triggered by the widget itself or by one of its stories. Here it will always be widget.
cpTitlestringtitle of website that triggered the event.
eventUrlstringurl of website that triggered the event.
cpBaseUrlstringdomain name of website that triggered the event.
cpScreenResolutionstringbrowser's resolution.
cpScreenColornumberColors depth of browser. See native documentation .
cpBrowserLanguagestringbrowser's language.
cpUserAgentstringbrowser's user agent. See native documentation
hitbooleanwhether analytics were enabled or not.

Story event payload

The story events share the following payload :

NameTypeDescription
eventTypestringEvent's type. See above for the full list.
eventOwnerstringJOIN identifier of the customer.
storyWorkspacestringlegacy information. For newer client, it should always be ws_default.
storySlugstringalways web-story-slug.
storyIdstringStory's id.
storyPageCountnumbernumber of pages in the Story.
storyPageEngagementCountnumbernumber of pages with a cta button.
cpIndexnumberstory's index inside the widget.
datenumberevent's time.
eventCategorystoryevent was triggered by the widget itself or by one of its stories. Here it will always be story.
cpTitlestringalways web-story-title.
eventUrlstringurl of website that triggered the event.
cpScreenResolutionstringbrowser's resolution.
cpScreenColornumberColors depth of browser. See native documentation .
cpBrowserLanguagestringbrowser's language.
cpUserAgentstringbrowser's user agent. See native documentation
cpDocumentReferrerstringIt is either web-list-bubble or web-solo-stickydepending on the widget's type.
hitbooleanwhether analytics were enabled or not.

Event example

Here a widget payload:

{
    "eventOwner": "join-stories",
    "cpWidgetAlias": "inspiration-galerie-audiences",
    "cpWidgetType": "list-bubble",
    "cpWidgetVersion": "4",
    "eventWidgetWorkspaces": [
        "ws_default"
    ],
    "date": 1722852202110,
    "eventCategory": "widget",
    "cpTitle": "My website",
    "eventUrl": "https://example.join-stories.com/my-widget",
    "cpBaseUrl": "https://example.join-stories.com/my-widget",
    "cpScreenResolution": "1512x982",
    "cpScreenColor": 30,
    "cpBrowserLanguage": "en",
    "cpUserAgent": "mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/127.0.0.0 safari/537.36",
    "hit": true,
    "eventType": "componentVisible50"
}

And a story payload:

{
    "storyPageCount": 20,
    "storyPageEngagementCount": 0,
    "eventOwner": "join-stories",
    "storyId": "7ec2ad55-d37c-42e3-ac4b-3b0d000e1042",
    "storySlug": "web-story-slug",
    "storyWorkspace": "ws_default",
    "date": 1722852299269,
    "eventCategory": "story",
    "cpTitle": "web-story-title",
    "eventUrl": "https://example.join-stories.com/my-widget",
    "cpDocumentReferrer": "web-list-bubble",
    "cpScreenResolution": "1512x982",
    "cpScreenColor": 30,
    "cpBrowserLanguage": "en",
    "cpUserAgent": "mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/127.0.0.0 safari/537.36",
    "hit": true,
    "cpIndex": 0,
    "eventType": "storyPageVisible"
}