Skip to main content
All CollectionsReal-time Audience Segmentation
Using audience segmentation custom events?
Using audience segmentation custom events?

Learn what custom events for audience segmentation are and how to trigger them.

W
Written by Will Wadman
Updated over a week ago

LimeSpot Audience Segmentation engine relies on automatic user behavior tracking. This provides numerous options for creating personalized experiences based on shoppers' page visits, store activities, and various interactions with products.

In some cases, there might be a need to create segments based on specific user activities not automatically handled by our standard event tracking. For example, you might want to add audience members to a segment when they click a specific link on the home page or add a product to the cart from a custom landing page. This is where custom events come into play.

This is a technical guide and requires basic understanding of JavaScript.

What are custom events?

Custom events are user-defined events that can be used to track a non-standard user activity, which could then be used in the Audience Segmentation module for defining segment criteria. Each custom event has 3 attributes:

  • customEventIdentifier (required): The internal identifier (or title) you assign to the event, which will be used to identify those events in the segment criteria.

  • count (optional - default: 1): An optional parameter to track the number of times the event has been triggered. For example, if you are tracking a special add to cart event, you might want to provide the quantity of items added to cart as count.

  • value (optional - default: 0): An optional parameter to track a value associated with the event. For example, if you are tracking a special add to cart event, you might want to provide the product price as the value.

How to track custom events?

Custom events can be tracked on the client-side via Javascript. The LimeSpot Storefront Library (already included on all storefronts) provides a method for tracking the custom events with the input parameters as described above. Here's an example of of a custom event:

<script>
LimeSpot.tracker.logCustomEvent({
customEventIdentifier: "custom_event",
count: 2,
value: 100.54
});
</script>

How to use custom events to create audience segments?

There are 3 specialized types of criteria available on the audience segment definition page that could be used to define segments based on the tracking described above:

  • Custom event value to create segments based on the total value of the tracked events (sum of all value amounts submitted).

  • Custom event value average to create segments based on the average value (average of all value amounts submitted).

  • Custom event count to create segments based on the total number of times the event has been triggered (sum of all count values).

In order to create segments based on these criteria, you can login to your LimeSpot App > Audience Segments. Click Create and select the Blank option. Then define the Custom Event criteria you need.

Want to use LimeSpot custom events with Shopify Flow? Simply follow this guide.

Did this answer your question?