Skip to main content
Proxy PostMetric through your Next.js application.

Setup

Step 1: Create proxy route

Create a file at app/api/track.js/route.ts:

Step 2: Update tracking script URL

Update your tracking script to use your domain:

Proxy tracking endpoint

You can also proxy the tracking endpoint itself:

Next steps

Proxy setup guide

Learn more about proxying PostMetric