chore: eventing

This commit is contained in:
Cory Dransfeldt 2024-03-24 15:31:27 -07:00
parent a895bf0753
commit a6507d44aa
No known key found for this signature in database

View file

@ -19,8 +19,8 @@ export default async (request, context) => {
"Authorization": `Bearer ${FATHOM_KEY}` "Authorization": `Bearer ${FATHOM_KEY}`
}, },
}) })
.then(() => {}) .then((data) => console.log(data))
.catch(() => {}) .catch((err) => console.log(err))
} }
if (ig) return; if (ig) return;
@ -31,10 +31,10 @@ export default async (request, context) => {
if (!userId) await ids.set(id, id) if (!userId) await ids.set(id, id)
const idVal = await ids.get(id) const idVal = await ids.get(id)
url = `https://cdn.usefathom.com/?h=${encodeURIComponent(page)}&sid=CWSVCDJC&cid=${idVal}` url = `https://cdn.usefathom.com/?h=${encodeURIComponent(page)}&sid=CWSVCDJC&cid=${idVal}`
fathomEvent(`no-script-visit-id: ${idVal}`) await fathomEvent(`no-script-visit-id: ${idVal}`)
} else { } else {
url = `https://cdn.usefathom.com/?h=${encodeURIComponent(page)}&sid=CWSVCDJC&cid=${num}` url = `https://cdn.usefathom.com/?h=${encodeURIComponent(page)}&sid=CWSVCDJC&cid=${num}`
fathomEvent(`blocked-visit-id: ${num}`) await fathomEvent(`blocked-visit-id: ${num}`)
} }
fetch(url, { headers }) fetch(url, { headers })