# 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="https://4005174896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8uUFIFZLPiuuBm5QlAX8%2Fuploads%2Fm8x9tDKV23TmmQFpfQnJ%2FScreenshot%202023-10-16%20at%206.51.00%E2%80%AFPM.png?alt=media&#x26;token=4145d922-3741-4b3a-b3b2-86e8f692f7e8" 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.
