triggername
triggername
Property
triggername
PropertyThe triggername
property holds the name of the trigger that is currently resolving the variable.
Purpose
This property allows you to identify which trigger initiated the evaluation of the variable. It is particularly useful when the same variable is used across multiple triggers and you want to customize its behavior based on the trigger context.
Type
Type:
String
Example Value:
"pageview"
Use Case
You can use this.triggername
to write conditional logic based on the trigger name:
function() {
var x = this.triggername; // "pageview"
return window.location.href;
}
This enables advanced use cases such as:
Returning different values depending on the trigger
Logging or debugging trigger-specific behavior
Ensuring consistent data output based on trigger context
By leveraging triggername
, you gain greater control and transparency in multi-trigger setups.
Last updated
Was this helpful?