fix: fix bug with virtualPath

This commit is contained in:
jinhojang6 2024-08-30 22:21:33 +09:00
parent 1ef1b83612
commit e221b0f6c9
No known key found for this signature in database
GPG Key ID: 1762F21FE8B543F8
1 changed files with 7 additions and 2 deletions

View File

@ -69,12 +69,17 @@ function getQueryParam(param) {
let utmSource = getQueryParam('utm_source');
const currentUrl = window.location.href;
console.log(\`current url - \${currentUrl}\`);
let currentUrl = window.location.href;
if (currentUrl.endsWith('/')) {
currentUrl = currentUrl.slice(0, -1);
}
const virtualPath = \`\${currentUrl}_form_submission_\${utmSource}\`
if (utmSource) {
console.log(\`utm - \${utmSource}\`);
console.log(\`current url - \${currentUrl}\`);
console.log(\`virtual path - \${virtualPath}\`);
fathom.trackEvent(\`form submission - \${utmSource}\`);