1!function(){"use strict";var hostname,parts,CONFIG={domain:"fp-sign.com",referrersToIgnore:["fp-sign"],storageMethod:"cookies",storageKey:"utm_params",storageExpiryDays:90,enableLinkDecoration:!1,subdomainPattern:"",enableHubspotLegacy:!0,enableHubspotV4:!0,enableCalendarHelper:!0,enableDataLayerPush:!0,dataLayerEventName:"formSubmission",cleanupAfterSubmission:!0,formFields:{utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content",gclid:"utm_gclid",fbclid:"utm_fbclid"},conversionTypeFields:["recent_conversion_type","recentconversiontype","recent_conversion_event_name"],hubspot:{portalId:"6784703",calendarFormId:"77361abc-df61-43c6-9109-6042b81c207d",formEndpoint:"https://api.hsforms.com/submissions/v3/integration/submit/",v4MaxWaitAttempts:20,v4WaitInterval:250},debugMode:!1,handleHistoryChange:!0,organicHostnames:["google","bing","yahoo","duckduckgo","baidu","yandex","facebook","linkedin","twitter","instagram","pinterest","chatgpt","gemini","claude","perplexity","meta"]};if(CONFIG.domain||(CONFIG.domain=(hostname=window.location.hostname,1===(parts=hostname.split(".")).length?hostname:parts.length>=2?parts.slice(-2).join("."):hostname)),0===CONFIG.referrersToIgnore.length){var domainParts=CONFIG.domain.split(".");domainParts.length>=2&&CONFIG.referrersToIgnore.push(domainParts[domainParts.length-2])}function debugLog(){if(CONFIG.debugMode&&window.console&&console.log){var args=Array.prototype.slice.call(arguments);console.log.apply(console,["[UTM]"].concat(args))}}function log(){if(window.console&&console.log){var args=Array.prototype.slice.call(arguments);console.log.apply(console,["[UTM]"].concat(args))}}function getCookie(name){for(var nameEQ=name+"=",cookies=document.cookie.split(";"),i=0;i<cookies.length;i++){var c=cookies[i].trim();if(0===c.indexOf(nameEQ))try{return decodeURIComponent(c.substring(nameEQ.length))}catch(e){return null}}return null}function setStorage(k,v,d){"localStorage"===CONFIG.storageMethod?function(key,value,days){try{var record={value:value};days&&(record.expiry=(new Date).getTime()+24*days*60*60*1e3),localStorage.setItem(key,JSON.stringify(record))}catch(e){}}(k,v,d):function(name,value,days){var expires="";if(days){var date=new Date;date.setTime(date.getTime()+24*days*60*60*1e3),expires="; expires="+date.toUTCString()}var cookie=name+"="+encodeURIComponent(value)+expires+"; path=/; domain=."+CONFIG.domain+"; SameSite=Lax";"https:"===window.location.protocol&&(cookie+="; Secure"),document.cookie=cookie}(k,v,d)}function getStorage(k){return"localStorage"===CONFIG.storageMethod?function(key){try{var str=localStorage.getItem(key);if(!str)return null;var record=JSON.parse(str);return record.expiry&&(new Date).getTime()>record.expiry?(localStorage.removeItem(key),null):record.value}catch(e){return null}}(k):getCookie(k)}function deleteStorage(k){var name;"localStorage"===CONFIG.storageMethod?function(key){try{localStorage.removeItem(key)}catch(e){}}(k):(name=k,document.cookie=name+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=."+CONFIG.domain)}function getURLParam(name){var results=new RegExp("[\\?&]"+name.replace(/[\[\]]/g,"\\$&")+"=([^&#]*)").exec(window.location.search);return results?decodeURIComponent(results[1].replace(/\+/g," ")):null}function mergeObjects(a,b){var key,result={};for(key in a)a.hasOwnProperty(key)&&(result[key]=a[key]);for(key in b)b.hasOwnProperty(key)&&(result[key]=b[key]);return result}function dispatchEvent(name,detail){try{window.dispatchEvent(new CustomEvent(name,{detail:detail}))}catch(e){var evt=document.createEvent("CustomEvent");evt.initCustomEvent(name,!0,!0,detail),window.dispatchEvent(evt)}}CONFIG.subdomainPattern||(CONFIG.subdomainPattern=CONFIG.domain);var UTMHandler={utmKeys:["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","fbclid"],init:function(){debugLog("Init - domain:",CONFIG.domain,"storage:",CONFIG.storageMethod),this.handleUTMParameters(),CONFIG.handleHistoryChange&&this.setupHistoryListener(),CONFIG.enableLinkDecoration&&"localStorage"===CONFIG.storageMethod&&this.setupLinkDecoration()},handleUTMParameters:function(){debugLog("Processing:",window.location.href);for(var stored=this.getUTMData()||{}
1,urlParams={},hasNew=!1,i=0;i<this.utmKeys.length;i++){var key=this.utmKeys[i],value=getURLParam(key);if(value){if("gclid"!==key&&"fbclid"!==key&&(value=value.toLowerCase()),("gclid"===key||"fbclid"===key)&&stored[key]===value)continue;urlParams[key]=value,hasNew=!0}}if(hasNew){var updated=mergeObjects(stored,urlParams);this.setUTMData(updated),log("UTM updated from URL:",updated),dispatchEvent("utm_updated",updated)}else document.referrer?this.handleReferrer():this.handleDirect()},handleReferrer:function(){try{for(var refHost=new URL(document.referrer).hostname.toLowerCase(),i=0;i<CONFIG.referrersToIgnore.length;i++)if(-1!==refHost.indexOf(CONFIG.referrersToIgnore[i].toLowerCase()))return void debugLog("Ignoring internal referrer:",refHost);var existing=this.getUTMData(),medium=existing.utm_medium||"";if("direct"!==medium&&"none"!==medium&&""!==medium)return void debugLog("Keeping existing attribution, not overwriting with referrer");for(var parts=refHost.split("."),domain=parts.length>=2?parts[parts.length-2]:refHost,isOrganic=!1,j=0;j<CONFIG.organicHostnames.length;j++)if(-1!==domain.indexOf(CONFIG.organicHostnames[j])){isOrganic=!0;break}var updated=mergeObjects(existing,{utm_source:domain,utm_medium:isOrganic?"organic":"referral"});this.setUTMData(updated),log("UTM updated from referrer:",updated),dispatchEvent("utm_updated",updated)}catch(e){}},handleDirect:function(){var existing=this.getUTMData();if(!existing||!existing.utm_medium){var direct={utm_source:"direct",utm_medium:"none"};this.setUTMData(direct),debugLog("Set direct traffic"),dispatchEvent("utm_updated",direct)}},getUTMData:function(){var data=getStorage(CONFIG.storageKey);if(data)try{return"string"==typeof data?JSON.parse(data):data}catch(e){return{}}return{}},setUTMData:function(data){setStorage(CONFIG.storageKey,JSON.stringify(data),CONFIG.storageExpiryDays)},clearUTMData:function(){deleteStorage(CONFIG.storageKey),log("UTM data cleared")},setupHistoryListener:function(){var self=this,push=history.pushState,replace=history.replaceState;history.pushState=function(){push.apply(history,arguments),self.handleUTMParameters()},history.replaceState=function(){replace.apply(history,arguments),self.handleUTMParameters()},window.addEventListener("popstate",function(){self.handleUTMParameters()})},setupLinkDecoration:function(){var self=this;document.addEventListener("click",function(e){for(var target=e.target;target&&target!==document;){if(target.tagName&&"a"===target.tagName.toLowerCase()&&target.href){try{var url=new URL(target.href);if(-1!==url.hostname.indexOf(CONFIG.subdomainPattern)&&url.hostname!==window.location.hostname){var utm=self.getUTMData();if(utm){for(var keys=Object.keys(utm),i=0;i<keys.length;i++)url.searchParams.has(keys[i])||url.searchParams.append(keys[i],utm[keys[i]]);target.href=url.toString()}}}catch(err){}break}target=target.parentNode}})}},HubSpotLegacyHandler={init:function(){CONFIG.enableHubspotLegacy&&(debugLog("HubSpot Legacy handler init"),this.setupListeners())},setupListeners:function(){var self=this;window.addEventListener("message",function(e){e.data&&"hsFormCallback"===e.data.type&&("onFormReady"===e.data.eventName||"onFormSubmit"===e.data.eventName?self.prefillForm():"onFormSubmitted"===e.data.eventName&&self.handleSubmission(e.data.id,e.data.data))}),window.addEventListener("utm_updated",function(){setTimeout(function(){self.prefillForm()},300)}),new MutationObserver(function(mutations){for(var i=0;i<mutations.length;i++)if(mutations[i].addedNodes.length){setTimeout(function(){self.prefillForm()},300);break}}).observe(document.body,{childList:!0,subtree:!0})},prefillForm:function(){var utm=UTMHandler.getUTMData();if(utm&&0!==Object.keys(utm).length)for(var keys=Object.keys(utm),i=0;i<keys.length;i++){var key=keys[i],fieldName=CONFIG.formFields[key]||key;this.setField(fieldName,utm[key])}},setField:function(name,value){var fields=document.querySelectorAll('[name="'+name+'"]');if(!fields.length){var wrapper=document.querySelector(".hs_"+name);wrapper&&(fields=wrapper.querySelectorAll("input"))}for(var i=0;i<fields.length;i++){fields[i].value=value,fields[i].setAttribute("value",value);try{fields[i].dispatchEvent(new Event("change",{bubbles:!0}))}catch(e){}}},handleSubmission:function(formId,data){if(debugLog("Legacy form submitted:",formId),CONFIG.enableDataLayerPush){var values=data&&data.submissionValues?data.submissionValues:{},formType=this.getConversionType(values);this.pushToDataLayer(formId,formType,"legacy")}CONFIG.cleanupAfterSubmission&&UTMHandler.clearUTMData()},getConversionType:function(values){for(var i=0;i<CONFIG.conversionTypeFields.length;i++){var field=CONFIG.conversionTypeFields[i];if(values[field])return values[field]}return""},pushToDataLayer:function(formId,formType,version){var payload={event:CONFIG.dataLayerEventName,formId:formId,formType:formType,formVersion:version},utm=UTMHandler.getUTMData();if(utm)for(var keys=Object.keys(utm),i=0;i<keys.length;i++){var key=keys[i];payload["utm_"+key.replace(/^utm_/,"")]=utm[key]}window.dataLayer=window.dataLayer||[],window.dataLayer.push(payload),debugLog("DataLayer push:",payload)}},HubSpotV4Handler={init:function(){CONFIG.enableHubspotV4&&(debugLog("HubSpot V4 handler init"),this.waitForV4())},waitForV4:function(){var self=this,attempts=0;!function check(){attempts++,"undefined"!=typeof HubSpotFormsV4?self.setupListeners():attempts<CONFIG.hubspot.v4MaxWaitAttempts&&setTimeout(check,CONFIG.hubspot.v4WaitInterval)}()},setupListeners:function(){var self=this;window.addEventListener("hs-form-event:on-submission:success",function(event){try{HubSpotFormsV4.getFormFromEvent(event).getFormFieldValues().then(function(fields){for(var values={},i=0;i<fields.length;i++)values[fields[i].name]=fields[i].value;self.handleSubmission(event.detail.formId,values)})}catch(err){console.error("[UTM] V4 error:",err)}})},handleSubmission:function(formId,values){debugLog("V4 form submitted:",formId);var email=values.email||values["0-1/email"];if(email&&CONFIG.enableCalendarHelper&&CalendarHandler.handleBooking({meetingsPayload:{bookingResponse:{contact:{email:email}}}}),CONFIG.enableDataLayerPush){for(var formType="",i=0;i<CONFIG.conversionTypeFields.length;i++)if(values[CONFIG.conversionTypeFields[i]]){formType=values[CONFIG.conversionTypeFields[i]];break}HubSpotLegacyHandler.pushToDataLayer(formId,formType,"v4")}CONFIG.cleanupAfterSubmission&&UTMHandler.clearUTMData()}},CalendarHandler={init:function(){CONFIG.enableCalendarHelper&&CONFIG.hubspot.portalId&&CONFIG.hubspot.calendarFormId&&(debugLog("Calendar handler init"),window.addEventListener("message",function(event){event.data&&event.data.meetingBookSucceeded&&CalendarHandler.handleBooking(event.data)}))},handleBooking:function(data){var utm=UTMHandler.getUTMData();if(utm&&0!==Object.keys(utm).length){var email;try{email=data.meetingsPayload.bookingResponse.contact.email}catch(e){return}if(email){for(var fields=[{name:"email",value:email}],keys=Object.keys(utm),i=0;i<keys.length;i++)fields.push({name:CONFIG.formFields[keys[i]]||keys[i],value:utm[keys[i]]});var endpoint=CONFIG.hubspot.formEndpoint+CONFIG.hubspot.portalId+"/"+CONFIG.hubspot.calendarFormId;fetch(endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({submittedAt:Date.now(),fields:fields,context:{hutk:getCookie("hubspotutk"),pageUri:window.location.href}})}).then(function(res){res.ok&&CONFIG.cleanupAfterSubmission&&UTMHandler.clearUTMData()}).catch(function(){})}}}};
1function init(){try{UTMHandler.init(),HubSpotLegacyHandler.init(),HubSpotV4Handler.init(),CalendarHandler.init(),log("Initialized v3.1.0 - domain:",CONFIG.domain)}catch(e){console.error("[UTM] Init error:",e)}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",init):init(),window.UTM_CONFIG=CONFIG,window.getUTMParameters=function(){return UTMHandler.getUTMData()},window.clearUTMData=function(){UTMHandler.clearUTMData()},window.debugUTM=function(){console.log("âââ UTM Debug âââ"),console.log("Config:",CONFIG),console.log("Stored UTM:",UTMHandler.getUTMData());var forms=document.querySelectorAll('[class*="hsForm_"]');console.log("HubSpot forms found:",forms.length);for(var i=0;i<forms.length;i++){var fields=forms[i].querySelectorAll('input[type="hidden"]');console.log("Form",i+1,"hidden fields:",fields.length)}console.log("âââââââââââââââââ")}}(); 2//# sourceURL=https://6784703.fs1.hubspotusercontent-eu1.net/hubfs/6784703/hub_generated/template_assets/1/378001767613/1773681469987/template_utm-handler.js
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.