# triggername

### `triggername` Property

The `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:

```js
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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jentis.com/developer-guide/variables/client-side-variables/public-function-scope/triggername.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
