Event reference
Every event the tag fires automatically (from data-p-event or convention). Custom events you fire via window.periscale.track() are forwarded as-is.
Lifecycle
| Event | When |
|---|---|
$pageview | Initial page load and any client-side route change. |
$pageleave | Page is hidden or unloaded. |
page_not_found | Page rendered with data-p-not-found or path matches a 404 route. |
Auth
| Event | When |
|---|---|
user_logged_in | Fire after successful login. |
user_signed_up | Fire after successful signup. |
user_logged_out | Fire on logout. |
Products
| Event | When |
|---|---|
product_viewed | A [data-p-product-id] element scrolls into view. |
product_clicked | A [data-p-event="product_clicked"] element is clicked. |
product_options_opened | Quick-view / variant overlay is opened. |
product_image_viewed | Carousel index changes. |
image_zoom_opened | Zoom modal is opened. |
image_load_failed | An image inside an instrumented region fails to load. |
Cart
| Event | When |
|---|---|
add_to_cart | Click on a [data-p-event="add_to_cart"] element. |
add_to_cart_disabled | Click on a disabled add-to-cart with data-p-event="add_to_cart_disabled". |
product_removed_from_cart | Click on a [data-p-event="remove_from_cart"] element. |
cart_quantity_updated | Quantity input value changes. |
cart_viewed | Visitor lands on cart route or opens cart drawer. |
cart_cleared | Cart is emptied. |
quantity_changed | A quantity stepper button is clicked. |
variant_selected | A variant button is clicked. |
Wishlist · Search · Catalog
| Event | When |
|---|---|
wishlist_add, wishlist_remove | Click on the wishlist toggle. |
product_searched | Search form submitted; search_query extracted from input. |
search_result_clicked | A product link inside the /search route is clicked. |
catalog_filter_applied | URL search params change on a catalog route. |
catalog_sort_changed | A sort selector value changes. |
Checkout · Payment
| Event | When |
|---|---|
checkout_started | Visitor lands on the /checkout route. |
checkout_completed | A [data-p-event="checkout_completed"] element is rendered. |
coupon_applied | A coupon form is submitted. |
order_placed | A [data-p-event="order_placed"] element with data-p-total is rendered. |
payment_initiated, payment_completed, payment_failed | Fire from your checkout integration. |
UI · Forms
| Event | When |
|---|---|
mega_menu_opened, mobile_menu_opened | Menu state mutates to open. |
announcement_dismissed | Click on a dismiss button with data-p-event="announcement_dismissed". |
hero_slide_viewed | Hero carousel index changes. |
form_validation_error | A form field gets aria-invalid="true". |
form_abandoned | Visitor types in a [data-p-form] form then leaves without submitting. |
contact_form_submitted | Contact form with data-p-event="contact" is submitted. |
newsletter_signup_attempted | Newsletter form with data-p-event="newsletter" is submitted. |
Engagement
| Event | When |
|---|---|
scroll_depth_reached | Each of the 25 / 50 / 75 / 100% thresholds, once per route. |
time_on_page | Fires on $pageleave with duration_ms and active_ms (excludes time the tab was hidden). |
rage_click | 3+ clicks on the same element within 800 ms. |
dead_click | A click on an element that didn't navigate or change the DOM. |
Performance
| Event | When |
|---|---|
web_vital_lcp | Largest Contentful Paint, on pagehide. |
web_vital_inp | Interaction to Next Paint (worst), on pagehide. |
web_vital_cls | Cumulative Layout Shift, on pagehide. |
web_vital_fcp | First Contentful Paint. |
web_vital_ttfb | Time to First Byte. |
Errors
| Event | When |
|---|---|
$exception | window.onerror or unhandled promise rejection. |
api_error | A fetch() to your API returned a non-2xx status. |
slow_api_response | A fetch() took longer than 2 seconds. |
Cross-surface
| Event | When |
|---|---|
chat_widget_opened, chat_widget_closed | Periscale chat widget is opened or closed on the same page. |
chat_message_sent | Visitor sends a message in the chat widget. |