feat: add gtm to load in us only (#16146)

* add gtm to load in us only

* fix: Tried to give typescript some help

* fix: Alternative fix

* fix: Add yarn.lock

* fix: Oops

* fix: type err

---------

Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-08-14 09:31:01 +00:00
1 parent f206b3d135
commit c41e5ddc2c
6 files changed
+165 -32

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
import type { NextApiRequest, NextApiResponse } from "next";
export default function handler(req: NextApiRequest, res: NextApiResponse) {
const country = req.headers["x-vercel-ip-country"] || "Unknown";
res.setHeader("Cache-Control", "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400");
res.status(200).json({ country });
}