From 1ef1b836120cebdee2fc08317cbfd687c479cfc7 Mon Sep 17 00:00:00 2001 From: jinhojang6 Date: Fri, 30 Aug 2024 21:12:07 +0900 Subject: [PATCH] chore: add virtualPath --- src/components/Fathom.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/Fathom.tsx b/src/components/Fathom.tsx index db92216..b90eaa1 100644 --- a/src/components/Fathom.tsx +++ b/src/components/Fathom.tsx @@ -69,9 +69,19 @@ function getQueryParam(param) { let utmSource = getQueryParam('utm_source'); +const currentUrl = window.location.href; +console.log(\`current url - \${currentUrl}\`); +const virtualPath = \`\${currentUrl}_form_submission_\${utmSource}\` + if (utmSource) { console.log(\`utm - \${utmSource}\`); + console.log(\`virtual path - \${virtualPath}\`); + fathom.trackEvent(\`form submission - \${utmSource}\`); + + fathom.trackPageview({ + url: virtualPath + }); } ` document.body.appendChild(script)