# Triggers

### Trigger Types

| Label | Type               | Description                        |
| ----- | ------------------ | ---------------------------------- |
| PV    | Page View          | Fires on page load                 |
| CL    | Click              | Fires on element click             |
| CE    | Custom Event       | Fires on dataLayer.push event      |
| FS    | Form Submit        | Fires on form submission           |
| SD    | Scroll Depth       | Fires at scroll depth threshold    |
| TM    | Timer              | Fires at set intervals             |
| HC    | History Change     | Fires on URL change (SPA)          |
| EV    | Element Visibility | Fires when element enters viewport |
| WL    | Window Loaded      | Fires when page fully loads        |

***

### How to add a trigger

1. Select a trigger type from the left library panel
2. Drag it onto the canvas or click to add
3. Enter the trigger name in the right settings panel
4. Connect a Condition (CT) node if needed

\[📸 IMAGE: Left library panel with trigger types highlighted]

***

### Naming Convention

We recommend naming triggers using this format:

```
[Type] - [Description]

Examples:
PV - All Pages
CE - create_project
CL - Pricing Button
FS - Sign Up Form
```

> 💡 Click the **prefix suggestion button** to auto-fill the correct prefix for each trigger type.

***

### Custom Event Trigger

The most commonly used trigger for GA4 event tracking.

```typescript
// This code fires the CE trigger
window.dataLayer?.push({
  event: 'create_project',  // ← Must match the CE trigger name exactly
  project_id: '123',
})
```

> ⚠️ The CE trigger name and the dataLayer event value must match exactly — including capitalization.

***

### Note for SPA frameworks

If you use Next.js, React, or other SPA frameworks, page navigation does not trigger a real page load.

Use the **History Change (HC)** trigger alongside **Page View (PV)** to capture virtual page views.


---

# 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://taviqo.gitbook.io/taviqo-docs/features/triggers.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.
