Advanced Mode JavaScript™ example
In Advanced mode, this event looks like the following:
// Generated by Discover Event Manager
// NOTE: Do not change event name
function NS$E__ADVANCED_MODE_EVENT__634339708610416368()
{
if (!($S.IsBot))
{
// Set fact for Report Group: No Dimension Report Group
$F.setFact("NS.F_E__ADVANCED_MODE_EVENT__634336419284199494", "TLT$NULL");
}
}
Examine the components:
function NS$E__ADVANCED_MODE_EVENT__634339708610416368()
- This statement defines the event as a function.
NS$E__ADVANCED_MODE_EVENT__634339708610416368is the full name of the event.NSis the namespace, which is a unique identifier for each Discover customer. This value cannot be changed within the Discover solution.$is a function name delimiter between the namespace and the internal function name.Esignifies that the function implements an event.ADVANCED_MODE_EVENTis the user-selected name of the event.- After the event was created, this name does not change even if the name is changed in the GUI.
634339708610416368is a string that is added to the object name to guarantee uniqueness.- It is based on the created time epoch and other factors. This string value is used to enable multiple events that have the same name in the GUI.
- Underscores (
_) are used to separate individual words in the name. - Double underscores (
__) are used to separate the parts of the internal name.
if (!($S.IsBot))
- This string is the condition definition.
$Sis the type of object that is used in the condition. In this case, it is a session attribute.IsBotis the name of the session attribute. In this case, it is a system session attribute and not a custom session attribute, although that information is not indicated in the string.!is theNOToperator that is applied to the session attributeIsBot.
$F.setFact("NS.F_E__ADVANCED_MODE_EVENT__634336419284199494", "TLT$NULL");
- This string writes the value of the event.
$Fis the fact collection object. Write the value into the Fact for this event.setFactis the method in the fact collection object that is used to set the value of the fact specified."NS.F_E__ADVANCED_MODE_EVENT__634336419284199494"is the name of the fact to which the value is written.NSis the namespace, which is a unique for the customer.F_Eis the type of the object to which method is writing. In this case, it is the Fact for Event.ADVANCED_MODE_EVENT__634339708610416368is the internal name of the object.
"TLT$NULL"is the value to record. In this case, the dimension constant value for null values is recorded.- Within the Event Manager, you can define a standard value that
is recorded for a dimension when a null value is detected. In the JavaScript™, this value is
referenced using
TLT$NULL.
- Within the Event Manager, you can define a standard value that
is recorded for a dimension when a null value is detected. In the JavaScript™, this value is
referenced using