In this article, you’ll learn:
Events in VWO
Any action performed by the visitor on the website is referred to as an Event. This can be a click on an offer banner, making a payment, scrolling down the page, etc. Each event has a name and a set of properties that describe it. An event called "Transaction" may have attributes like "transaction ID" and "amount".
Each Event contains the following details:
|Action||A visitor-performed activity|
|Properties||These give more context to the Event, allowing you to acquire valuable insights.
For example, a cart abandonment event can have properties like “product ID”, “cart value”, etc.
How are Events useful?
An event can be used as an indicator to track any visitor action that is crucial to your business, such as “conversions”, “cart abandonment”, etc. This can then be used to target visitors for your VWO campaigns.
Here’s an example:
Assume a visitor on your website clicked the checkout CTA button. Here,
- Action would be "Click Checkout”.
- Properties may include “Visitor ID”, “Item ID in the cart”, “Timestamp”, “Cart Value”, etc.
How do Events work?
- Once an event is created in VWO Data360, it needs to be linked to your website to capture the event whenever it is triggered.
- You may also provide additional information for an event by adding properties that define it.
- It requires a custom code to be installed on your website and applied with the required variables to capture the event and any property associated with it.
- Once ready, VWO starts collecting the information corresponding to the event.
- The event can now be used to track visitor behavior and target visitors for your campaigns.
Types of Events in VWO
In VWO, Events are of the following two types:
- Standard Events: These are predefined events on the VWO platform and can be used in campaigns and metrics, such as Page scroll, Time spent on a page, etc.
- My Events (Custom Events): These are the ones that you can create and configure based on your specific business needs.
For example, a Product Manager at an eCommerce business may want to track all the cart additions and convert them into transactions. To make this possible, they need to attend to those visitors that abandon the cart. In such a scenario, they can create a custom event in the name "Abandon Cart" and configure it to be used in their campaign to target those visitors to accomplish the purchase.
Creating Events in VWO
Let’s say you want to create an event to capture the failed payments, which might be due to multiple reasons such as declined payment, visitor’s session ended, delayed response of your website’s server, etc. To know about this, you need to create an event capturing the failed payments and set up all the possible reasons as its properties. To do so, from the main menu panel, access Data360 > Events. Click +Create and enter the details in the following fields:
|Event Name||Enter the name of the event|
|API Name||Enter the endpoint name for your event.
NOTE: By default, this field gets populated based on the value you have entered in the Event Name field. However, you can modify it.
|Description||Enter a description that defines your event|
Under the Properties section, enter the details in the following fields that help you track those payment skips:
|Property||Enter the name of the property that helps to identify a specific attribute of the event|
|Default Type||Select the type (Text, Number, or Boolean) for your event property|
|API Name||Enter the endpoint name for your event property
NOTE: By default, this field gets populated based on the value you have entered in the Property field. However, you can modify it.
If you wish to add a description to the event property, use the Description field that can be accessed by clicking on the vertical ellipsis (⋮) > Configure. Once done, click Save.
Post configuring, click Create. The created custom event appears in the MY EVENTS section on the left.
Clicking on a custom event displays the details of the same along with a custom code snippet. The code snippet is available for the web version (browser-based) and SDKs (for FullStack). These code snippets contain the placeholders for the property variables, which need to be applied in the respective places. This ensures that each time the event is triggered, it captures the variable data from your website and stores them in VWO. These variables differ with the type of code; hence you need to apply the variables correspondingly.
For server-side SDKs, by integrating the VWO server-side SDKs with your application, you can A/B test your applications on the server-side. For integrating an SDK, you just need to install the SDK from the respective package manager and then import it into your application. Since backend applications can be written in different programming languages, we offer VWO SDKs in Node.js, Python, PHP, Java, .NET, Ruby, and Go languages. The custom event code is therefore also made available in all these languages.
Click on the Copy Code icon at the top-right corner of the code snippet box to copy the code. After initializing the VWO SDK and the corresponding variables into your code repository, use this code in your application to enable this custom event for pre-campaign segmentation.
Managing Events in VWO
Once an event is created, you can modify or clone the same based on your need. To do so, click on the custom event that you wish to work on and perform the required action as follows:
- To Edit - Click on the Edit icon on the top-right, make the required changes, and click Save.
NOTE: The existing inputs in the API Name and the Default Type fields cannot be modified.
- To Clone - Click on the Clone icon on the top right, enter the Event Name and the API Name, apply the required changes, and click Create.
The cloned event appears in the MY EVENTS section on the left.
Targeting Visitors Using Events in VWO
Events are applied for pre-segmentation purposes in your campaigns. To do so, perform the following steps:
- For VWO Testing and VWO Personalize campaigns, once you have set up the campaign URL, access More Options > Enable campaign for a specific visitor group > Custom Segment.
- Now create a custom segment, where you want to track all the visitors who performed the given action. In the dropdown corresponding to who performed, select an event and click + where to define the property.
In the first dropdown corresponding to where, select an appropriate property, in the second dropdown, set the relation, and enter/select the required value correspondingly in the last field. To add more properties, click + and where.. to define them.
The following example highlights the targeting condition set for visitors who would make purchases of $20 and above.
- You can add more conditions by clicking Add another condition.
- Once done, click Save Segment to apply the targeting condition for your campaign.