# Website Analytics

## Overview

Use [Leto](https://leto.gg/) with an IPFS hosted website to monitor traffic, watch for system abuse, and improve your system.&#x20;

In this example, an HTML webpage is uploaded to IPFS via [Web3.storage](https://web3.storage/) and is retrieved using the [Leto IPFS gateway](https://letodev.gitbook.io/getting-started/documentation/ipfs-gateway-api). Anonymous analytics data is then accessible through the [Leto dashboard](https://leto.gg/) or [Analytics API](https://letodev.gitbook.io/getting-started/documentation/analytics-rest-api).

## Link in Bio webpage on IPFS

We made a Link in Bio webpage for this example. Feel free to make any type of webpage that suits your needs!

Create a simple html webpage to display your important links. View the code used in this example [here](https://github.com/Leto-gg/examples/tree/main/linkInBio). For this example, there is some basic css in the index.html file to make it easy to upload to IPFS via [Web3.storage](https://web3.storage/).

<figure><img src="/files/esXrKmE8trXd7ziDQjPO" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
If you want to include other files (like a separate css file) or have an app like a react app, you will have to build it and then upload the build folder to [Web3.storage](https://web3.storage/). You can use providers like [Spheron](https://spheron.network/) and [Dappling](https://dappling.network/) to build the file and launch the app on IPFS for you.
{% endhint %}

### Web3.storage <a href="#web3.storage" id="web3.storage"></a>

Login to [web3.storage](https://web3.storage/), make a space, and upload your index.html file.

​​

<figure><img src="/files/6QQYQuPOl5bM0oITPm61" alt="" width="375"><figcaption></figcaption></figure>

Now, the index.html file (in this case a webpage) is accessible by clicking the link under “CID”. <https://bafkreiedazv25tc7idkywbco3jxrywdnb3g4ff3pqegrmshhtcpk5zgsyi.ipfs.w3s.link>

<figure><img src="/files/ohvRQNR3nNUf9gyl4ASM" alt="" width="563"><figcaption></figcaption></figure>

To collect anonymous analytics for this webpage, input your CID into the following link format `https://leto.gg/ipfs/{yourCID}` instead of using the link provided by web3.storage: <https://leto.gg/ipfs/bafkreiedazv25tc7idkywbco3jxrywdnb3g4ff3pqegrmshhtcpk5zgsyi>

When users retrieve the webpage through this link, anonymous analytics data is generated. It’s that easy to host a webpage on IPFS and measure webpage performance with Leto!

## Interacting with your analytics

Use the Leto dashboard to view the analytics data generated by your webpage. Login at [Leto.gg](https://leto.gg/) and select “CIDs''. Input the CID for your website. <br>

<figure><img src="/files/VvPxNmhmlZ7lvXuyuxXh" alt="" width="563"><figcaption></figcaption></figure>


---

# 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://letodev.gitbook.io/getting-started/website-analytics.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.
