# Visitor Tracker

The example script, *Visitor Tracker* (*VisitorTrackerExample.cs*)*,* tracks the number of visitors that visited your experience over the course of a session. Grab the file at the download link at the end of the page.

Instructions

Here is a step-by-step guide to using the script:

1. Download the script file from the download link at the end of this article.
2. Follow the instructions provided in [Working with scripts](/latest/creating-in-sansar/working-with-scripts.md) to upload the script and add it to an object.
3. Open the object's Properties panel and go to the Script Settings section.
4. At the bottom of the object's properties panel is a Script Settings section. Set the parameters according to the Script parameters section of this article.
5. Once you have finished these steps, your script is ready. Save and build your scene.
6. If you want to verify if the script is running correctly, visit the built scene.
7. While visiting the scene, open the Chat app.
8. In the chat field, type the command that you have set. In this example, `/visitors`. This prompts the script to run and a message box opens showing a log of all the visitors who have visited the scene.

   ![chat\_type.png](https://i3.wp.com/help.sansar.com/hc/article_attachments/115007619167/chat_type.png)

Script parameters

| ![vistor\_tracker.png](https://i3.wp.com/help.sansar.com/hc/article_attachments/115012623846/vistor_tracker.png) |
| ---------------------------------------------------------------------------------------------------------------- |
| The parameters for Visitor Tracker                                                                               |

| Parameter field    | Description                                                                                                                                                           |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OwnerName          | If you prefer to have the script listen only to your commands, set the **OwnerName** to your display name. Otherwise, leave it blank to let anyone issue the command. |
| VisitorListCommand | The word you would like to use as a command. For this example, let's use "/visitors" as a command.                                                                    |

**Notes:**

A few notes for the *VisitorTrackerExample.cs* example script:

* The script logs the visitors who came and visited your experience.
* This script only runs until an experience session ends. Once it ends, the tracker resets and all data is lost.
* An experience session ends when your scene has been empty (no visitors) for some time.

[**Creative Commons License**](/latest/creative-commons-license.md)

Have more questions? Join our [Discord!](https://discord.gg/sansarofficial)


---

# 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.sansar.com/latest/script-api-docs/example-scripts/visitor-tracker.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.
