Trustlytics Support Center > Behaviour > Events
In the “Events” section, you can see information for individual events associated with your website. Events require specific configuration. Once they are configured, you can view detailed reports by category, action, name, and value (optional).
Get valuable information and optimize your website with the report on events.
Configuration of events
To enable tracking of an event on your website, it is necessary to insert a JavaScript snippet directly into the source code of the website.
Links are a frequently used method for integrating event tracking.
Suppose you want to track in detail whether someone clicks on an email link. With JavaScript, you can add the “onClick” function to your links. A typical HTML email link looks like this:
<a href="mailto:info@mycompany.com" title="Send us an email">Send us an email</a>
The base tag a in HTML contains various attributes, including the link under href. By using the JavaScript function “onClick”, HTML links can be expanded to add more functionality:
<a href="mailto:info@mycompany.com" title="Send us an email" onclick="_paq.push(['trackEvent', 'Contact', 'Click email link', 'info@mycompany.com']);">Send us an email</a>
The second link essentially has the same format as the first link above, but with an additional “onClick” attribute. The JavaScript function that triggers the event is included in quotation marks. In the example above, this would be:
_paq.push(['trackEvent', 'Contact', 'Click email link', 'info@mycompany.com']);
The following event information is captured in the code example shown:
Event Categories: Contact
Event Actions: Click email link
Event Names: info@mycompany.com
The data is collected by informing Trustlytics that you want to capture data in Trustlytics (_paq.push([ ])) and “trackEvent” defines the type of data sent. Trustlytics recognizes the next attributes as category, action, name, and value of the event.
You may have noticed that in the above code, only three values are displayed after “trackEvent”. This is because the event value attribute is optional. If no value is required, you can simply omit the last attribute instead of adding an empty one.
Let's consider a scenario where you want to track a specific value:
Assuming you operate a small online shop and want to analyze when a customer adds a product to the wishlist.
In general, a link code to be added to the wishlist looks something like this:
<a href="add-wishlist.html?product='flowerpot-athena'">Add flowerpot Athena to the wishlist</a>
Now follows the creation of the code for the “onClick” event:
_paq.push(['trackEvent', 'eCommerce', 'Add to wish list', 'Flowerpot Athena' 20]);
Now we insert this code into the link and define it as an “onClick” event:
<a href="add-wishlist.html?product='flowerpot-athena'" onclick="_paq.push(['trackEvent', 'eCommerce', 'Add to wish list', 'Flowerpot Athena' 20]);">Add flowerpot Athena to the wishlist</a>
Important: Since the value is a number, no conventional quotation marks are required, as used in the previous text strings.
The following event information is captured in the code example shown:
Event Categories: eCommerce
Event Actions: Add to wish list
Event Names: Flowerpot Athena
Event value: 20
At any location where you can add the JavaScript snippet “onClick”, you have the opportunity to track an event. There are no limits to your creativity.
Analysis of events
The table “Event Categories” displays the categories of each tracked event, as well as their frequency. If an event has a value, it is added on the right side of the event category.
You can view the actions and names of the tracked events in the sub-tables of each row by using the plus and minus symbols on the left side.
The table “Event Actions” displays the action of each tracked event and their frequency. If an event has a value, it is added on the right side of the event's action.
You can view the names of the tracked events in the sub-tables of each row by using the plus and minus symbols on the left side.
The table “Event Names” displays the names of each tracked event and their frequency. If an event has a value, it is added on the right side of the event name.
You can view the actions of the tracked events in the sub-tables of each row by using the plus and minus symbols on the left side.
Get valuable information and optimize your website with the report on events
After collecting a series of events on your website, it's time to start analyzing. There are various options to do this. One option is to use the segmented visit logs and take a detailed look at the path of each individual user through your website.
The segmented visit logs
This function proves to be helpful in obtaining extremely precise insights into the end of events. For example, if you want to know when visitors to your website add a product to their wishlist and have defined this as a specific event, you can analyze individual users and see what actions they took before adding it. This allows you to focus on.
To view the segmented visit logs, navigate to the “Event Categories” section and search for the desired event. When you hover over the event title, two symbols should appear. The first symbol is the “Segmented visit logs,” which allows you to view a log for each person who has completed the respective event.
By clicking on this symbol, a pop-up window opens, displaying a summary of the session logs for each visitor who has completed the event. Information is provided about the number of actions performed and the duration of the visit.
This type of data can help you understand what leads to conversions and serve as a basis for driving the process faster. If you want to gain further insights into a specific user, you can click on “View visitor profile”.
Event logs, divided into segments, have high value for analyzing important events with few completed events. Through a thorough examination of each individual case, we can find out how it happened and whether there are opportunities to improve the process.
You can use the segmented visit logs in the event categories, event actions, and event names.
Row Evolution
The “Row Evolution” function is an alternative way to verify event data and analyze aggregated trends. This function is particularly useful when one does not want to deal with individual events but wants to gain a general understanding of how a specific metric develops over time.
To view the row evolution, navigate to the “Event Categories” section and search for the desired event. When you hover over the title of the event, two symbols should appear. The second symbol is the “Row Evolution” which allows you to view the event data and aggregated trends.
By clicking on this symbol, a pop-up window opens displaying a development chart showing the number of completed events over time, broken down by the period currently set in the Trustlytics dashboard.
An illustrative example of applying this view is when you make a significant change to the webpage where the event takes place. Let's take the “Add to Wishlist” button as an example: If you want to check whether your changes at a specific time have resulted in more people adding a product to their wishlist in the following month.
If you notice that the number of completed events has decreased, you can also use this function retrospectively. This way, you can find out when this trend started and try to find the cause for it.
You can use Row Evolution in event categories, event actions, and event names.