Event variables are the variables present in TagCommander events. They are used primarily for tracking user actions (button clicks, links, etc.).
Event variables are useful if you want to send data specific to an event without having these data on your site pages as external variables.
Example: you wish to assign an event for the “Send” button on your form. The event variables could be the user’s last name, first name, email address and telephone number. These are data that are not available when the page is loaded; it only becomes available after the user has completed the fields on the form and clicked “Send”.
Event variables must be added in the TagCommander interface before they can be used, and only for events, not tags.
Event variables must be created in the TagCommander interface before they can be used in an event. See the “Adding event variables” article to find out how to create an event variable in the interface.
All event variables created can be used:
- To add information to the solutions embedded in TagCommander (linking event variables and solutions is called mapping). See the “Mapping Tags’ Variables” article to find out how to map your variables in an event.
- To create activation rules for your events. See the “Adding Rules” section to find out how to create rules based on your event variables.
Event variables must be implemented in the TagCommander event function (tc_events).
Note: External variables that are already available on the page do not need to be implemented in your event. For example, you do not need to assign a “country” variable to an event if this information is already present in an external variable.
Here is an example of an event variable:
There are two situations in which you may need to declare your variables in the event variable management interface:
- You want to implement TagCommander events on a new site. The variables that your technical staff or technical provider implement in the site’s source code (in the tc_events function) must be declared in the interface first in order to be available to be added to your tags and rules.
- Variables are for your current event functions are missing or you want to add a new event to your site. Again, this variable must be declared in the interface first before it can be used in your tags and rules.
The “add” window consists of the following elements:
(1) “Name“: the variable’s name (mandatory field)
(2) “Type“: the variable’s type
(3) “Description“: A description of the variable, to clarify its name (e.g. “Page template” can be the description of the variable named “env_template”)
(4) “Detailed description“: A detailed description of the variable, to further clarify tits name (e.g. “possible values: homepage/category/product/funnel_confirmation” can be the detailed description of the “env_template” variable)
You can edit an internal variable by clicking the “Edit” icon (1) and delete it by clicking the “X” (2):