chore: add virtualPath

This commit is contained in:
jinhojang6 2024-08-30 21:12:07 +09:00
parent 5d12c40c0f
commit 1ef1b83612
No known key found for this signature in database
GPG Key ID: 1762F21FE8B543F8
1 changed files with 10 additions and 0 deletions

View File

@ -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)