--- url: /advanced/proxy.md --- # Proxying the Scripts Proxies are a more advanced setup and require you to install software. We recommend starting with the [server-side](/get-started/backend-integration) or [website](/get-started/frontend-integration) integration. For rewrites/redirects of the scripts, read [this](/faq#can-i-use-vercel-rewrites-redirects-to-proxy-the-scripts). As an alternative to using a proxy, you can set up a [custom domain](/advanced/custom-domains.md) with a Pirsch Plus subscription. ## What Is a Proxy and Why Should You Use It A proxy is self-hosted middleware that allows you to serve the Pirsch JavaScript snippets from your own domain. The advantage of this is that your website will only make first-party requests. Requests to pirsch.io are proxied through your server, preventing them from being blocked by ad or script blockers. Additionally, you can create rollup views and send data to multiple dashboards with a single request to the proxy, rather than requiring the client to make multiple requests. Here is an example of a JS snippet that uses your proxy. The integration for the event script is similar: ```html ``` As you can see, it loads the script from your own domain, using a relative path (`/pirsch/pirsch.min.js`). Page views will be sent to your own domain (on `/pirsch/hit`) and then forwarded to your Pirsch dashboard. ## Available Proxies We provide two proxy servers that you can install on your server. Both are open source and can be found on GitHub. The [PHP proxy](https://github.com/pirsch-analytics/pirsch-php-proxy) can be easily installed on any PHP server by downloading the latest version and unpacking it on your server. The [Go server](https://github.com/pirsch-analytics/pirsch-go-proxy) is suitable for any VPS (virtual private server) and can be installed using Docker or by running the executable directly on your server (e.g. using systemd on Linux). No additional software is required, making it lightweight and easy to install. See the readme on GitHub for details and installation instructions. You can also set up [Cloudflare Workers](https://workers.cloudflare.com/) to do the job. They are free for up to 100,000 requests per day. The instructions for the setup can be found [here](../advanced/cf-workers). There is also a [community provided integration for Astro](/integrations/astro) which acts as a proxy.