> For the complete documentation index, see [llms.txt](https://docs.formsort.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.formsort.com/integrations/getting-data-out/analytics.md).

# Analytics events

The lifecycle of tracking events within Formsort

<figure><img src="https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2FzHdUxrB18sk23FkWLgkw%2Fimage.png?alt=media&amp;token=1fa65ca5-aaab-4fdf-a9b6-3f72729c15a8" alt=""><figcaption><p>Enabled events in a Google Tag Manager integration</p></figcaption></figure>

You may choose to receive any or all of the following events:

| Event name         | Triggered when...                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **FlowLoaded**     | The flow is initially loaded.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **FlowClosed**     | The exit button in the flow has been clicked.                                                                                                                                                                                                                                                                                                                                                                                                    |
| **FlowFinalized**  | The flow has been completed because the user completed all steps or reached a finalizing or redirecting step.                                                                                                                                                                                                                                                                                                                                    |
| **StepLoaded**     | A step is loaded, even if for a second time, such as with backward navigation.                                                                                                                                                                                                                                                                                                                                                                   |
| **StepCompleted**  | A step is completed (all the required answers were provided and the user clicked next).                                                                                                                                                                                                                                                                                                                                                          |
| **UrlOpened**      | The responder is redirected to a URL outside of your flow.                                                                                                                                                                                                                                                                                                                                                                                       |
| **EmailCollected** | <p>The email identifying the user has been collected.<br></p><p>For this to be triggered, the <a href="/adding-questions-and-content/question-reference/email-address.md">email question</a> collecting the answer must have a <a href="/response-data-collection-and-management/variable-schema.md#semantic-meaning">data classification</a> of <code>responder\_email</code>, since a single flow might collect multiple email addresses. </p> |
| **PhoneCollected** | <p>The phone number identifying the user has been collected</p><p>For this to work, the <a href="/adding-questions-and-content/question-reference/phone-number.md">phone question</a> collecting the answer must have a <a href="/response-data-collection-and-management/variable-schema.md#semantic-meaning">data classification</a> of <code>responder\_phone</code>, since a single flow might collect multiple email addresses.</p>         |

{% hint style="info" %}
The above-listed events will be included in your answers payload, but library variables can also be added. [Library variables](/response-data-collection-and-management/variable-schema/system-library-answers.md) collect data based on the built-in attributes of a responder's environment (i.e. is\_mobile?) and context (i.e. StepID).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.formsort.com/integrations/getting-data-out/analytics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
