Skip to main content
All CollectionsDeveloper
Enhancing Session Insights With Custom Events
Enhancing Session Insights With Custom Events

A Guide to Tracking Custom Events with FullSession

Updated over 5 months ago

FullSession, a powerful web analytics tool, empowers users with the ability to gain deeper insights into user interactions on their websites. One notable feature that enhances this capability is the tracking of custom events. In this article, we will explore how FullSession users can effectively utilize custom events to enrich their sessions with time-specific, customized fields linked to crucial events within visited pages.

Understanding Custom Events

Custom events serve as a means to augment sessions with personalized information related to user interactions on a web page. These events are particularly useful for filtering sessions based on specific end-user actions, offering a more refined analysis of user behavior. To illustrate, let's consider a scenario where a FullSession user has integrated their account with an e-commerce website and wants to identify users who added a particular item, such as a "laptop," to their shopping carts.

Implementation of Custom Events

To achieve this, the website development team is tasked with invoking a JavaScript function when the user interacts with the relevant webpage element.

The FUS.event JavaScript API allows you to add a custom event to the event stream captured by FullSession.

FUS.event(eventName, eventProperties); //

The eventName parameter is a string containing the name of the event. The exact event name will be searchable via FullSession's filter search capabilities.

The eventProperties parameter is a JSON object containing additional information about the event. The set of properties relevant to each event may vary widely. Event properties will be searchable via FullSession filter.

eventName and eventProperties have specific formatting and content requirements. These requirements are detailed in the example below. If event names or properties do not meet these requirements, they will not be captured into FullSession.

In this example, the team is required to call the following function when the user clicks the "add to cart" button after selecting the desired item:

FUS.event("add-to-cart",{"item-id":"XXXXX", "price":"XXX", "model":"XXX", "item-category": "XXX", …})

This JavaScript function, FUS.event, is designed to capture and log the custom event "add-to-cart," along with associated event fields such as item ID, price, model, item category, and more.

Practical Examples of Custom Events

Let's explore practical examples of custom events in action:

Example 1: Tracking Product Addition to Cart

FUS.event('Product Added', { cart_id_str: '130983678493', product_id_str: '798ith22928347', sku_str: 'L-100', category_str: 'Clothing', name_str: 'Button Front Cardigan', brand_str: 'Bright & Bold', variant_str: 'Blue', price_real: 58.99, quantity_real: 1, coupon_str: '25OFF', position_int: 3, url_str: 'https://www.example.com/product/path', image_url_str: 'https://www.example.com/product/path.jpg' });

Example 2: Tracking User Subscription

FUS.event('Subscribed', { uid_str: '750948353', plan_name_str: 'Professional', plan_price_real: 299, plan_users_int: 10, days_in_trial_int: 42, // Additional custom fields specific to subscription events can be included here });

Navigating Custom Events in FullSession

After the user session concludes (typically 30 minutes after the last activity), FullSession provides a convenient way for users to access and analyze custom events. Users can locate the custom event name, such as "add-to-cart," under the custom event filter category.

Upon selecting the "add-to-cart" custom event, a dropdown list appears, displaying all related filter keys associated with this event. These filter keys include item ID, price, model, item category, and any other custom fields defined during the event implementation.

Refining Session Retrieval

With the custom event and its associated filter keys identified, FullSession users can refine their session retrieval process. By selecting a specific filter and specifying the desired value, users can retrieve sessions that match the specified criteria. In our example, a user could filter sessions based on the item ID, price, model, or item category associated with the "add-to-cart" event.

In conclusion, leveraging custom events in FullSession provides users with a powerful tool to gain in-depth insights into user interactions on their websites. By tracking and filtering sessions based on customized fields, users can refine their analysis and make data-driven decisions to enhance the user experience and optimize website performance. Implementing and navigating custom events is a valuable skill for FullSession users seeking a comprehensive understanding of user behavior.

Did this answer your question?