# View IPFS Analytics

## Overview

Help members of your community access analytics for their IPFS content. The [Leto Analytics API](https://letodev.gitbook.io/getting-started/documentation/analytics-rest-api) will return a view count for each piece of content.&#x20;

If your platform, website, or app uses [Leto Analytics](https://leto.gg/), your community can lookup analytics for IPFS content in your system.&#x20;

We hosted a version of this app [here](https://bafybeifvibof4xsvmovjb2jidkpzy2molzvcvjehmjzuweu3jssyxuezqy.ipfs.sphn.link/) (hosted on IPFS using [Spheron](https://spheron.network/))! Monitor engagement and potential system abuse on webpages, NFTs, blogs, and more. No login required!

To host this web-app for your community, use the instructions below and [this Github repo](https://github.com/galaxyxtwo/viewIpfsAnalytics) to get started.&#x20;

<figure><img src="/files/DjswFhAi1AurrLEWLOhr" alt=""><figcaption><p>UI for View IPFS Analytics</p></figcaption></figure>

## Getting Started

Follow the steps below to set up and run the React App in a local development environment.

1. **Clone the Repository**:

   ```
   git clone [https://github.com/galaxyxtwo/viewIpfsAnalytics]
   cd [viewIpfsAnalytics]
   ```
2. **Run the Development Server**:

   ```
   npm install
   npm start
   ```
3. **Add your IPFS CIDs**: Copy and paste your CIDs into the box to create a list! When running viewIpfsAnalytics, the inputs (cids) and associated analytics data are saved in local storage.

> ***Keep in mind***: Only IPFS CIDs that have been served through the [Leto IPFS Gateway](https://letodev.gitbook.io/getting-started/documentation/ipfs-gateway-api) will return analytics data.

\
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Note

/worker is Javascript code meant for a Cloudflare worker that processes api requests. /src is the front-end built with React. Use this repo to get started hosting your own app in the cloud!

## Leto Background

When a developer serves IPFS content (webpage, blog, NFT) with the [Leto IPFS gateway](https://letodev.gitbook.io/getting-started/documentation/ipfs-gateway-api), the analytics collected is publicly available via the [Leto Analytics api](https://letodev.gitbook.io/getting-started/documentation/analytics-rest-api).&#x20;

The View IPFS Analytics tool uses the [Leto Analytics api](https://letodev.gitbook.io/getting-started/documentation/analytics-rest-api) to retrieve and display anonymous, aggregate analytics for a given IPFS CID. End-users love having access to the data for business and fun!

We hope you find this useful! If your business needs more functionality, login to the [Leto dashboard](https://leto.gg/) for free and upgrade your service to a [pro plan](https://leto.gg/#about) when needed.

Learn more by visiting the [Leto docs](https://letodev.gitbook.io/getting-started/) or [Blog](https://blog.leto.gg/).

> ***Note***: In the future Leto will give developers a choice to opt in or out of this public dataset for privacy reasons. It will be up to each dev to commuinicate this with end users.


---

# 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/view-ipfs-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.
