Events
Learn about the events in your tracking plan
An event represents something that a user does or that happens in response to their actions. For example "Signup Attempted" is an action that the user did, while "Credit Card Validated" is something that happened to the user.
Tracking Plan Guide: How to Pick Your Events and Properties (opens in a new tab)
Event Definition
An event is defined in the Events section of the Tracking plan and can be organized into categories. The definition of an event includes:
- A descriptive Event Name
- A Description with information about the event beyond what the name includes (optional but highly recommended)
- Event Variants that include variations of the event for different scenarios (optional)
- Triggers that describe both visually and in words all the user or system actions that trigger the event (optional but highly recommended)
- Sources that the event should be sent from
- Actions associated with the event, including properties
- Metrics related to the event (optional)
- Categories that the event is a part of (optional)
- Tags associated with the event
- Name Mapping that the event name is mapped to when sending to specific destinations
Sources
Add all sources you want the event to be sent from to the event in Avo. If you want the event to be implemented with Avo Codegen, make sure "Implement with Codegen" is checked. Having "Implement with Codegen" checked adds the event to your type-safe Avo Codegen file for that source. If you don't want the event to be implemented with Avo Codegen, leave "Implement with Codegen" unchecked.
Actions
Actions is Avo's umbrella term over all the tracking methods the analytics platforms offer, such as logging events, updating user properties, logging revenue, etc. In your Avo tracking plan you can configure which actions (tracking methods) should be triggered. Actions can be triggered on their own or together, for example it's common to update user properties along with logging an event.
See supported actions (tracking methods) below.
Configuring Actions
Adding Actions
The default action when you add an event to your Avo tracking plan is to log an event.
To add an action, click +Add Action
in the Event modal and select the relevant action:
Removing Actions
To remove an action, click settings in the Action and select Remove
:
Supported Actions
Below is a list of possible actions, followed by a more detailed overview of each:
- Identify User: identifies the user in the analytics tool when sent. All events sent after this event will be tied to the identified user. Usually set on sign in events.
- Update User Properties: updates the associated user properties when sent.
- Log Event logs/tracks an event in your analytics tool.
- Log Revenue: logs revenue when this event is sent. Usually set on checkout events.
- Log Page View: logs page view in your analytics tool when this event is sent. Usually set on events that are sent on screen/page navigation.
- Unidentify User: unidentifies the user in your analytics tool when this event is sent. All events sent after this event will not be tied to the previously identified user. Usually set on sign out events.
- Update Groups: associates users with groups and/or updates group properties. Adding users to groups will link them in all subsequent calls.
Log Event
Logging an event is the fundamental action for behavioral analytics. An event describes an action that a user does in your application or something that happens for them. Additional information about the action, event properties, can be logged with the event.
When using Codegen, Avo creates one function for each event, that prepares all the required data to perform all associated actions and routes the data to the data destination. By doing so, Codegen makes your analytics as type-safe as possible, and takes care of sending the event to all your analytics tools.
Here's how sending and event called "Signup Completed" would look like:
Avo.signupStarted({ authenticationMethod: 'Facebook', email: 'hi@avo.sh' });
Log Event with Groups
When associating the event with groups you can imply that the event is linked with a group. This would typically be done if only certain actions of the user are related to a group.
With Codegen, groups are applied to tracking events with the following methods according to analytics platform:
- Amplitude: logEventWithGroups (opens in a new tab)
- Mixpanel: track_with_groups (opens in a new tab)
Identify User
The Identify User action should be used when you want to identify users from your system in your analytics platform. This would typically be on done when users either Sign up or Login or in other ways users are becoming authenticated users according your system.
The Identify User action can be triggered individually or along with logging an event. It's common to trigger the Identify User action along with log Signup Completed
and a Login Completed
events - in such cases, the Identify user call should occur first and then the log event call.
In the Codegen when the Identify User action is selected, Avo will require a user property called
User Id
. Below is a list of Identify User methods used for each supported analytics platform:
- Amplitude: setUserId (opens in a new tab)
- Segment: identify (opens in a new tab)
- Mixpanel: identify (opens in a new tab)
- Fullstory: Call identify (opens in a new tab)
Unidentify User
The Unidentify User action should be used when you want to unidentify users from your system in your analytics platform. This would typically be done when users Log Out, but not limited to that.
If you forget to unidentify users in your analytics platform you could potentially track two or more users as the same user in your analytics platform if they share a computer.
Below is a list of Unidentify User methods used for each supported analytics platform:
- Amplitude: setUserId (opens in a new tab) with User Id as null
- Segment: identify (opens in a new tab) with User Id as null
- Mixpanel: identify (opens in a new tab) with User Id as null
- Fullstory: identify (opens in a new tab) with User Id as false
Update User Properties
The Update User Properties action is used when the state of the user in your analytics platform should be updated. User properties are often updated at the same time as logging an event but they can also be updated independently.
User properties are updated with the following methods according to analytics platform:
- Amplitude:
setUserProperties
- Appsflyer: user properties not supported
- Facebook Analytics:
fbq('setUserProperties')
- Firebase Analytics:
setUserProperty
- Fullstory:
setUserVars
- Intercom:
Intercom('update', userProperties)
- Mixpanel:
people.set
- Segment:
identify
Update Groups
Avo is equipped with a familiar user interface to define and maintain Group Types and their properties and updating Group Properties is as easy as adding an action to your Event. Read more about Groups here .
Users can be associated with groups (and all subsequent calls) with the following methods according to analytics platform:
- Amplitude: setGroup (opens in a new tab)
- Mixpanel: set_group (opens in a new tab)
- Segment: group (opens in a new tab)
Furthermore, group properties can be updated with the following methods according to analytics platform:
- Amplitude: groupIdentify (opens in a new tab)
- Mixpanel: group.set (opens in a new tab)
- Segment: group (opens in a new tab) (links user as well)
Log Revenue
Some analytics destinations have revenue tracking separate from event tracking. Add the Log Revenue action to indicate that the event represents a successful purchase and should be used to track revenue. When using Avo Codegen this will result in your event function receiving an additional amount parameter that will then be passed on to the revenue
function in your destination interface. Read more on it in the Codegen docs.
Log Revenue in legacy Codegen destinations
Below are details for what Avo Codegen automatically does for each analytics platform. Note that this only applies to legacy Avo Codegen destinations and does not apply to destinations using the destination interface.
Legacy Amplitude Destination
For the Amplitude destination, Avo will add 4 event properties that match the Amplitude logRevenue API (opens in a new tab) with the prefix "Amplitude: ".
- Amplitude: Product Id
- Amplitude: Quantity
- Amplitude: Price
- Amplitude: Revenue Type
Call logRevenueV2 with these properties as well as all other event properties, and then call logEvent.
Legacy Segment Destination
For the Segment destination, Avo Codegen will add 2 event properties that match the Segment revenue properties (opens in a new tab) with the prefix "Segment: ".
- Segment: Revenue
- Segment: Currency
Segment currency will have constraint that the currencies need to be in a valid ISO format. For compiled languages this will generate an enum to guarantee that the currency is a valid ISO format, for JavaScript this will be validated during runtime.
Enums are currently not supported on Android and iOS.
Call track with the Segment revenue properties set in the correct keys to make sure that Segment recognizes the event as a Revenue event.
Legacy Mixpanel Destination
For the Mixpanel destination, Avo will add 1 event property that matches the Mixpanel track_charge API (opens in a new tab) with the prefix "Mixpanel: ".
- Mixpanel: Amount
Call people.track_charge with the price and all additional event properties and then call track
Log Page View
Add the Log Page View action to include page tracking on web and screen tracking on mobile.
Log Page View in the Codegen
When Log Page View is set on events, Avo Codegen will do the following for each platform
Segment
For the Segment platform, Avo will add 1 property that matches the Segment page property (opens in a new tab) with the prefix "Segment: ".
- Segment: Page Name
Calls either page or screen (depending on your apps platform) with the Page Name property and then call track. If you want to only log a page view, not an event, you can remove the Log Event action from the event.