In this article, you’ll learn:
Events in VWO
Any action performed by the visitor on the website or any web application 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 is given a name and a set of properties to add more context to the event. These events are used for targeting visitors for your campaigns and filtering your campaign reports.
For example, To analyze visitors’ shopping behaviour on an eCommerce website, you can create an event to capture the cart additions and associate properties like “product ID”, “cart value”, etc., to capture additional context. Once you have this information, you can use this event to target visitors for your VWO campaigns and segment visitors to filter your campaign reports.
How do Events work?
- You create an event in VWO Data360 and also define the event by adding properties.
- This event needs to be linked to your website, web app or mobile application to capture the event whenever it is triggered. 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 behaviour and target visitors for your campaigns, as well as to segment your visitors to filter the report data.
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.
- UNREGISTERED EVENTS: These are the events that are captured by VWO from your website but not found registered in VWO. At times, instead of creating an event on the VWO platform, you would use the custom code of an event and tweak it to become another to be tracked on your website. Sometimes, such unregistered events may also come into VWO from a third-party integration. In such cases, you may not be able to use the data of those events for any analysis or segmentation. But VWO captures such events and brings them to you, so you can choose to have them registered in VWO. If you’re passing an event to VWO that you have not created under MY EVENTS, VWO captures it and displays it under UNREGISTERED EVENTS.
NOTE: These events will continue to stay for 3 days or until registered.
Clicking on these events will reveal the following information:
Properties Displays the details pertaining to the event properties, such as the Data Type and API Name Sample Values Displays the latest five instances of the event that were captured from your website. This will help you decide whether to register the event or not
You can choose to save these events to VWO by clicking on the Register Event button at the top-right. This will allow you to configure the event properties and save them under MY EVENTS.NOTE: In case of passing a new property to an event that is already present under MY EVENTS, VWO will capture and display them under the Unregistered Properties section in the Properties tab of the corresponding event.
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|
|Data 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. To integrate 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 Data 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.
Using Events in VWO
Events can be used for targeting visitors in your VWO campaigns as well as for creating segments for your campaign reports. Having created an event to capture the failed payments. You can now use the same in two different places.
- You can use this event in your campaign to target those visitors that encountered payment failures so as to offer them an alternative payment method or even a special waiver to encourage them to accomplish the purchase.
- After the campaign has been executed, you can view its progress in the campaign reports. Here, you can analyze the success of your campaign by creating a filter to segment the report data corresponding to those visitors that have accomplished the purchase.
Targeting Visitors Using Events in VWO
To apply events for pre-segmentation purposes in your campaigns, 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 first dropdown, select an event and click + where to define the property.
In the dropdown corresponding to where, select an appropriate property, in the next 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 encounter payment failure.
- You can add more conditions by clicking Add another condition.
- Once done, click Save Segment to apply the targeting condition for your campaign.
Segmenting Reports Using Events in VWO
To apply events for post-segmentation purposes in your A/B test campaign, click on the VWO campaign you want to look into and go to Report > All Visitors > Custom Segment. You can follow the steps from step 2, mentioned in the Targeting Visitors Using Events in VWO section, to create a segment for your report.