@fynd-design-engineering/fynd-one-v2 3.4.19 → 3.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/global/auth.js +1 -1
- package/dist/global/auth.js.map +2 -2
- package/dist/global/css/in-project-settings.css +1 -1
- package/dist/global/css/in-project-settings.css.map +2 -2
- package/dist/tracking/user-journey.js +1 -1
- package/dist/tracking/user-journey.js.map +2 -2
- package/package.json +1 -1
package/dist/global/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let i="https://api.console.fynd.com/service/panel/auth/v1.0/session/";function o(e){document.querySelectorAll("[fynd-console-auth-status]").forEach(
|
|
1
|
+
"use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let i="https://api.console.fynd.com/service/panel/auth/v1.0/session/";function o(e){document.querySelectorAll("[fynd-console-auth-status]").forEach(n=>{n.setAttribute("fynd-console-auth-status",e?"true":"false")})}function l(e){let s=e.firstName||"",n=s.charAt(0)||"";o(!0),document.querySelectorAll('[fynd-console-auth="name"]').forEach(t=>{t.textContent=s}),document.querySelectorAll('[fynd-console-auth="user-blob"]').forEach(t=>{t.style.display="block"}),document.querySelectorAll('[fynd-console-auth="initial-text"]').forEach(t=>{t.textContent=n});let a=document.querySelectorAll('[fynd-console-auth="image"]');e.profilePicUrl?a.forEach(t=>{t.src=e.profilePicUrl,t.style.display="block"}):a.forEach(t=>{t.style.display="none"}),localStorage.setItem("console_user",JSON.stringify(e))}function c(){o(!1),document.querySelectorAll('[fynd-console-auth="user-blob"]').forEach(n=>{n.style.display="none"}),document.querySelectorAll('[fynd-console-auth="name"]').forEach(n=>{n.textContent="Sign in"}),localStorage.removeItem("console_user")}let r=localStorage.getItem("console_user");if(r)try{let e=JSON.parse(r);e&&e.firstName&&l(e)}catch{}fetch(i,{method:"GET",credentials:"include"}).then(e=>e.json()).then(e=>{let s=e.user;s&&s.firstName?l(s):c()}).catch(()=>{c()})});})();
|
package/dist/global/auth.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/global/auth.ts"],
|
|
4
|
-
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "document.addEventListener('DOMContentLoaded', () => {\n type SessionUser = {\n
|
|
5
|
-
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACVA,WAAS,iBAAiB,oBAAoB,MAAM;
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "document.addEventListener('DOMContentLoaded', () => {\n type SessionUser = {\n firstName?: string;\n profilePicUrl?: string;\n };\n\n type SessionResponse = {\n user?: SessionUser;\n };\n\n const API_URL =\n 'https://api.console.fynd.com/service/panel/auth/v1.0/session/';\n\n function setAuthStatus(value: boolean) {\n const statusElements = document.querySelectorAll<HTMLElement>(\n '[fynd-console-auth-status]'\n );\n statusElements.forEach(el => {\n el.setAttribute('fynd-console-auth-status', value ? 'true' : 'false');\n });\n }\n\n function userLoggedIn(user: SessionUser) {\n const firstName = user.firstName || '';\n const initial = firstName.charAt(0) || '';\n\n setAuthStatus(true);\n\n const nameElements = document.querySelectorAll<HTMLElement>(\n '[fynd-console-auth=\"name\"]'\n );\n nameElements.forEach(el => {\n el.textContent = firstName;\n });\n\n const userBlobElements = document.querySelectorAll<HTMLElement>(\n '[fynd-console-auth=\"user-blob\"]'\n );\n userBlobElements.forEach(el => {\n el.style.display = 'block';\n });\n\n const initialTextElements = document.querySelectorAll<HTMLElement>(\n '[fynd-console-auth=\"initial-text\"]'\n );\n initialTextElements.forEach(el => {\n el.textContent = initial;\n });\n\n const imageElements =\n document.querySelectorAll<HTMLImageElement>('[fynd-console-auth=\"image\"]');\n\n if (user.profilePicUrl) {\n imageElements.forEach(img => {\n img.src = user.profilePicUrl as string;\n img.style.display = 'block';\n });\n } else {\n imageElements.forEach(img => {\n img.style.display = 'none';\n });\n }\n\n // store in localStorage\n localStorage.setItem('console_user', JSON.stringify(user));\n }\n\n function userNotLoggedIn() {\n setAuthStatus(false);\n\n const userBlobElements = document.querySelectorAll<HTMLElement>(\n '[fynd-console-auth=\"user-blob\"]'\n );\n userBlobElements.forEach(el => {\n el.style.display = 'none';\n });\n\n const nameElements = document.querySelectorAll<HTMLElement>(\n '[fynd-console-auth=\"name\"]'\n );\n nameElements.forEach(el => {\n el.textContent = 'Sign in';\n });\n\n // remove stored data\n localStorage.removeItem('console_user');\n }\n\n // Step 1: check localStorage first\n const cached = localStorage.getItem('console_user');\n if (cached) {\n try {\n const cachedUser = JSON.parse(cached) as SessionUser;\n if (cachedUser && cachedUser.firstName) {\n userLoggedIn(cachedUser);\n }\n } catch { }\n }\n\n // Step 2: hit API and enforce truth\n fetch(API_URL, {\n method: 'GET',\n credentials: 'include'\n })\n .then(response => response.json() as Promise<SessionResponse>)\n .then(data => {\n const user = data.user;\n\n if (user && user.firstName) {\n userLoggedIn(user);\n } else {\n userNotLoggedIn();\n }\n })\n .catch(() => {\n userNotLoggedIn();\n });\n});"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B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;AAAA,QAC9B;AAAA,MACJ;AACA,uBAAiB,QAAQ,QAAM;AAC3B,WAAG,MAAM,UAAU;AAAA,MACvB,CAAC;AAED,YAAM,eAAe,SAAS;AAAA,QAC1B;AAAA,MACJ;AACA,mBAAa,QAAQ,QAAM;AACvB,WAAG,cAAc;AAAA,MACrB,CAAC;AAGD,mBAAa,WAAW,cAAc;AAAA,IAC1C;AAGA,UAAM,SAAS,aAAa,QAAQ,cAAc;AAClD,QAAI,QAAQ;AACR,UAAI;AACA,cAAM,aAAa,KAAK,MAAM,MAAM;AACpC,YAAI,cAAc,WAAW,WAAW;AACpC,uBAAa,UAAU;AAAA,QAC3B;AAAA,MACJ,QAAQ;AAAA,MAAE;AAAA,IACd;AAGA,UAAM,SAAS;AAAA,MACX,QAAQ;AAAA,MACR,aAAa;AAAA,IACjB,CAAC,EACI,KAAK,cAAY,SAAS,KAAK,CAA6B,EAC5D,KAAK,UAAQ;AACV,YAAM,OAAO,KAAK;AAElB,UAAI,QAAQ,KAAK,WAAW;AACxB,qBAAa,IAAI;AAAA,MACrB,OAAO;AACH,wBAAgB;AAAA,MACpB;AAAA,IACJ,CAAC,EACA,MAAM,MAAM;AACT,sBAAgB;AAAA,IACpB,CAAC;AAAA,EACT,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[fynd-sticky-target]{height:90vh;position:sticky;top:12vh;z-index:2}[fynd-scroll-blocks]{display:none}[fynd-scroll-source]{height:80vh}[fynd-sticky-source]{height:80vh;width:100%;position:absolute;top:0;opacity:0;background-color:transparent}[fynd-scroll-container]{opacity:0}[fynd-sticky-target]{height:80vh;border-radius:1rem;overflow:hidden}[fynd-scroll-column]{padding-left:0rem;padding-right:0rem}.progressive-scroll-image{object-fit:cover}@media (max-width: 991px){[fynd-scroll-container]{opacity:0;display:none}[fynd-scroll-blocks]{display:flex}[fynd-sticky-source]{height:auto;position:static;opacity:1}[fynd-scroll-source]{height:auto}}[fynd-console-auth=user-blob]{display:none}[fynd-console-auth-status
|
|
1
|
+
[fynd-sticky-target]{height:90vh;position:sticky;top:12vh;z-index:2}[fynd-scroll-blocks]{display:none}[fynd-scroll-source]{height:80vh}[fynd-sticky-source]{height:80vh;width:100%;position:absolute;top:0;opacity:0;background-color:transparent}[fynd-scroll-container]{opacity:0}[fynd-sticky-target]{height:80vh;border-radius:1rem;overflow:hidden}[fynd-scroll-column]{padding-left:0rem;padding-right:0rem}.progressive-scroll-image{object-fit:cover}@media (max-width: 991px){[fynd-scroll-container]{opacity:0;display:none}[fynd-scroll-blocks]{display:flex}[fynd-sticky-source]{height:auto;position:static;opacity:1}[fynd-scroll-source]{height:auto}}[fynd-console-auth=user-blob]{display:none}[fynd-console-auth-status=true]{padding:0 14px 0 4px!important}[fynd-console-auth-status=false]{padding:0 16px!important}[style-nav-primary-button=white] [fynd-console-auth=initial-text]{color:#fff}[style-nav-primary-button=white] [fynd-console-auth=user-blob]{background-color:#0e0e0e}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/global/css/in-project-settings.css"],
|
|
4
|
-
"sourcesContent": ["/* Progressive scroll css start */\n[fynd-sticky-target]{\n height: 90vh;\n
|
|
5
|
-
"mappings": ";AACA,CAAC;AACG,UAAQ;
|
|
4
|
+
"sourcesContent": ["/* Progressive scroll css start */\n[fynd-sticky-target] {\n height: 90vh;\n position: sticky;\n top: 12vh;\n z-index: 2;\n}\n\n[fynd-scroll-blocks] {\n display: none;\n}\n\n/* main element to decide the scroll height*/\n[fynd-scroll-source] {\n height: 80vh;\n}\n\n[fynd-sticky-source] {\n height: 80vh;\n width: 100%;\n position: absolute;\n top: 0px;\n opacity: 0;\n background-color: transparent;\n}\n\n[fynd-scroll-container] {\n opacity: 0;\n}\n\n[fynd-sticky-target] {\n height: 80vh;\n border-radius: 1rem;\n overflow: hidden;\n}\n\n[fynd-scroll-column] {\n padding-left: 0rem;\n padding-right: 0rem;\n}\n\n.progressive-scroll-image {\n object-fit: cover;\n}\n\n/* disable everything from tablet and below */\n@media (max-width: 991px) {\n [fynd-scroll-container] {\n opacity: 0;\n display: none;\n }\n\n [fynd-scroll-blocks] {\n display: flex;\n }\n\n [fynd-sticky-source] {\n height: auto;\n position: static;\n opacity: 1;\n }\n\n [fynd-scroll-source] {\n height: auto;\n }\n}\n\n/* Progressive scroll css end */\n\n/* auth css start */\n[fynd-console-auth=\"user-blob\"] {\n display: none;\n}\n\n[fynd-console-auth-status=\"true\"] {\n padding: 0 14px 0 4px !important;\n\n}\n\n[fynd-console-auth-status=\"false\"] {\n padding: 0 16px 0 16px !important;\n\n\n}\n[style-nav-primary-button=\"white\"] [fynd-console-auth=\"initial-text\"] {\n color: #ffffff;\n}\n[style-nav-primary-button=\"white\"] [fynd-console-auth=user-blob] {\n background-color: #0e0e0e;\n}\n/* auth css end */"],
|
|
5
|
+
"mappings": ";AACA,CAAC;AACG,UAAQ;AACR,YAAU;AACV,OAAK;AACL,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;AAGA,CAAC;AACG,UAAQ;AACZ;AAEA,CAAC;AACG,UAAQ;AACR,SAAO;AACP,YAAU;AACV,OAAK;AACL,WAAS;AACT,oBAAkB;AACtB;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,UAAQ;AACR,iBAAe;AACf,YAAU;AACd;AAEA,CAAC;AACG,gBAAc;AACd,iBAAe;AACnB;AAEA,CAAC;AACG,cAAY;AAChB;AAGA,OAAO,CAAC,SAAS,EAAE;AACf,GAAC;AACG,aAAS;AACT,aAAS;AACb;AAEA,GAAC;AACG,aAAS;AACb;AAEA,GAAC;AACG,YAAQ;AACR,cAAU;AACV,aAAS;AACb;AAEA,GAAC;AACG,YAAQ;AACZ;AACJ;AAKA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS,EAAE,KAAK,EAAE;AAEtB;AAEA,CAAC;AACG,WAAS,EAAE,KAAK,EAAE;AAGtB;AACA,CAAC,gCAAkC,CAAC;AAChC,SAAO;AACX;AACA,CAAC,gCAAkC,CAAC;AAChC,oBAAkB;AACtB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{function U(e,t){return t.platform!=="none"?t:e}function D(){let t=document.referrer.toLowerCase(),n=new URL(window.location.href),a=n.searchParams.get("utm_source")?.toLowerCase()||"",i=n.searchParams.get("utm_medium")?.toLowerCase()||"",s=n.searchParams.get("utm_campaign")?.toLowerCase()||"",g=n.searchParams.get("utm_content")?.toLowerCase()||"",p=`${t} ${a} ${i} ${s} ${g}`,d={platform:"none",type:"unknown",context:"unknown",confidence:"low",detectionMethod:"none",detectedAt:new Date().toISOString()},c=[{keywords:["chatgpt","openai","chat.openai"],platform:"ChatGPT",type:"ai_chat",context:"conversational_query",confidence:"high"},{keywords:["perplexity"],platform:"Perplexity",type:"ai_search",context:"research_query",confidence:"high"},{keywords:["claude","anthropic"],platform:"Claude",type:"ai_chat",context:"conversational_query",confidence:"high"},{keywords:["bing","copilot","microsoft-copilot"],platform:"Bing_Copilot",type:"ai_chat",context:"conversational_query",confidence:"medium"},{keywords:["gemini","bard","google-ai"],platform:"Google_Gemini",type:"ai_chat",context:"conversational_query",confidence:"high"},{keywords:["you.com","you-ai"],platform:"You_AI",type:"ai_search",context:"search_query",confidence:"medium"},{keywords:["character.ai","character"],platform:"Character_AI",type:"ai_chat",context:"character_interaction",confidence:"high"},{keywords:["poe","quora-poe"],platform:"Poe",type:"ai_chat",context:"conversational_query",confidence:"high"},{keywords:["huggingface","hf-chat"],platform:"HuggingFace",type:"ai_chat",context:"technical_query",confidence:"medium"},{keywords:["replika"],platform:"Replika",type:"ai_chat",context:"personal_assistant",confidence:"high"}];for(let h of c){let r=h.keywords.find(u=>p.includes(u));if(r){d={platform:h.platform,type:h.type,context:h.context,confidence:h.confidence,detectionMethod:x(r,t,a,i),detectedAt:new Date().toISOString()};break}}return d.platform==="none"&&(d=b(a,i,s,g)),d}function x(e,t,n,a){return t.includes(e)?"referrer":n.includes(e)?"utm_source":a.includes(e)?"utm_medium":"utm_other"}function b(e,t,n,a){let i=[{condition:t.includes("ai")||t.includes("chat"),platform:"AI_Generic",type:"ai_unknown",context:"utm_tagged",confidence:"medium"},{condition:n.includes("ai-assistant")||n.includes("chatbot"),platform:"AI_Campaign",type:"ai_chat",context:"campaign_driven",confidence:"medium"},{condition:a.includes("ai-generated")||a.includes("llm"),platform:"AI_Content",type:"ai_content",context:"content_discovery",confidence:"medium"}];for(let s of i)if(s.condition)return{platform:s.platform,type:s.type,context:s.context,confidence:s.confidence,detectionMethod:"utm_pattern",detectedAt:new Date().toISOString()};return{platform:"none",type:"unknown",context:"unknown",confidence:"low",detectionMethod:"none",detectedAt:new Date().toISOString()}}function J(e,t){let n=t.platform!=="none";if(!n)return{isAIUser:!1,aiTouchPoints:0,aiEntryPage:null,behaviorPatterns:{skipsBranding:!1,researchIntensive:!1,quickDecision:!1,technicalFocus:!1},platformInsights:{expectedJourney:"n/a",actualVsPredicted:"matched",platformTypicalBehavior:"n/a"}};let a=e.userJourney.find(c=>c.aiContext?.isAIReferral)?.page||e.userJourney[0]?.page||null,i=e.userJourney.filter(c=>c.aiContext?.aiInfluenced).length,s=e.userJourney.map(c=>c.page.toLowerCase()),g=e.userJourney.map(c=>c.type.toLowerCase()),p={skipsBranding:!s.some(c=>c.includes("about")||c==="/")&&s.length>1,researchIntensive:e.userJourney.length>5||g.filter(c=>c.includes("solution")||c.includes("blog")).length>2,quickDecision:s.some(c=>c.includes("contact")||c.includes("demo")||c.includes("pricing"))&&e.userJourney.length<=3,technicalFocus:g.some(c=>c.toLowerCase().includes("api")||c.toLowerCase().includes("developer"))||s.some(c=>c.includes("api")||c.includes("developer"))},d={expectedJourney:k(t.platform,a),actualVsPredicted:F(e,t.platform),platformTypicalBehavior:M(t.platform)};return{isAIUser:n,aiTouchPoints:i,aiEntryPage:a,aiConversionPath:s,aiSessionDuration:N(e),aiPageDepth:e.userJourney.length,behaviorPatterns:p,platformInsights:d}}function k(e,t){return{ChatGPT:"solutions_exploration",Perplexity:"research_deep_dive",Claude:"technical_evaluation",Bing_Copilot:"quick_overview",Google_Gemini:"comparative_analysis"}[e]||"general_exploration"}function F(e,t){let n=e.userJourney.length;return e.userJourney.some(i=>i.page.includes("contact")||i.page.includes("demo")||i.page.includes("pricing"))&&n>=3?"exceeded":n>=2?"matched":"underperformed"}function M(e){return{ChatGPT:"Direct to solutions, conversion-focused",Perplexity:"Research-heavy, multiple page views",Claude:"Technical documentation focus",Bing_Copilot:"Quick overview, efficiency-focused",Google_Gemini:"Comparative analysis, thorough evaluation"}[e]||"General exploration pattern"}function N(e){if(e.userJourney.length<2)return 0;let t=new Date(e.userJourney[0].time),n=new Date(e.userJourney[e.userJourney.length-1].time);return Math.floor((n.getTime()-t.getTime())/1e3)}async function A(){let e="userJourney";function n(){let r=navigator.userAgent;return/tablet|ipad|playbook|silk/i.test(r)?"Tablet":/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(r)?"Mobile":"Desktop"}function a(){let r=navigator.userAgent;return r.includes("Chrome")&&!r.includes("Edg")?"Chrome":r.includes("Firefox")?"Firefox":r.includes("Safari")&&!r.includes("Chrome")?"Safari":r.includes("Edg")?"Edge":r.includes("Opera")?"Opera":"Unknown"}function i(){let r=navigator.userAgent;if(/iPhone/.test(r)){let o=r.match(/iPhone\s*([^;]*)/);return o?`iPhone ${o[1].trim()}`:"iPhone"}if(/iPad/.test(r)){let o=r.match(/iPad\s*([^;]*)/);return o?`iPad ${o[1].trim()}`:"iPad"}if(/Android/.test(r)){let o=r.match(/;\s*([^)]*)\s*\)/);return o&&o[1].trim().replace(/wv/g,"").replace(/Build\/.*$/g,"").replace(/\s+/g," ").trim()||"Android Device"}return/Windows/.test(r)?/Windows NT 10/.test(r)?"Windows 10/11 PC":/Windows NT 6\.3/.test(r)?"Windows 8.1 PC":/Windows NT 6\.2/.test(r)?"Windows 8 PC":/Windows NT 6\.1/.test(r)?"Windows 7 PC":"Windows PC":/Macintosh/.test(r)?/Intel/.test(r)?"Mac (Intel)":/Apple Silicon|ARM64/.test(r)?"Mac (Apple Silicon)":"Mac":/Linux/.test(r)?"Linux PC":/BlackBerry/.test(r)?"BlackBerry":/Windows Phone/.test(r)?"Windows Phone":n().charAt(0).toUpperCase()}function s(r){if(!r)return"Unknown";try{let m=new URL(r).hostname.replace(/^www\./,""),f=m.split(".");return f.length>=2?f[0]:m||"Unknown"}catch{return"Unknown"}}function g(r,u){let o=new URLSearchParams(window.location.search),m=o.has("utm_source")||o.has("utm_medium")||o.has("utm_campaign");return r||m?m?{source:o.get("utm_source")||"",medium:o.get("utm_medium")||"",campaign:o.get("utm_campaign")||"",content:o.get("utm_content")||"",term:o.get("utm_term")||""}:{source:s(document.referrer),medium:"organic",campaign:"unknown"}:u||{source:"Unknown",medium:"organic",campaign:"unknown"}}function p(){try{return typeof window.pageCategories<"u"&&Array.isArray(window.pageCategories)&&window.pageCategories.length>0?window.pageCategories:["Not applicable"]}catch(r){return console.warn("Error accessing pageCategories:",r),["Not applicable"]}}function d(){let r=new URLSearchParams(window.location.search);return r.has("utm_source")||r.has("utm_medium")||r.has("utm_campaign")}function c(r){let u=r.split("?")[0].toLowerCase(),o={exactMatches:{"/":"Home","/home":"Home","/blog":"Blog listing","/about-us":"About us","/contact-us":"Contact","/privacy-policy":"Privacy policy","/terms-of-service":"Terms of service","/careers":"Careers","/customer-stories":"Customer stories listing","/events":"Events listing","/infographics":"Infographics listing","/newsroom":"Newsroom","/releases":"Releases listing"},pathStartsWith:[{pattern:"/blog/",type:"Blog"},{pattern:"/customer-stories/",type:"Customer story"},{pattern:"/case-studies/",type:"Case study"},{pattern:"/solutions/",type:"Solution"},{pattern:"/events/",type:"Event"},{pattern:"/news/",type:"News"},{pattern:"/press-releases/",type:"Press release"},{pattern:"/releases/",type:"Release"}]};if(o.exactMatches[u])return o.exactMatches[u];for(let m of o.pathStartsWith)if(u.startsWith(m.pattern))return m.type;return"Other"}function h(r){if(!r.userJourney||r.userJourney.length===0)return!1;let u=new Date(r.userJourney[r.userJourney.length-1].time);return new Date().getTime()-u.getTime()<18e5}return new Promise(r=>{setTimeout(()=>{try{let u=D(),o=null,m=sessionStorage.getItem(e);if(m){let y=JSON.parse(m);h(y)&&(o=y)}if(!o)o={userJourney:[],origin:window.location.hostname,deviceCategory:n(),browser:a(),device:i(),formDetails:{formId:"",formName:"",firstName:"",lastName:"",email:"",phone:""},aiData:u,aiJourneyAnalytics:{isAIUser:!1,aiTouchPoints:0,aiEntryPage:null,behaviorPatterns:{skipsBranding:!1,researchIntensive:!1,quickDecision:!1,technicalFocus:!1},platformInsights:{expectedJourney:"n/a",actualVsPredicted:"matched",platformTypicalBehavior:"n/a"}}};else{let y=U(o.aiData||{platform:"none",type:"unknown",context:"unknown",confidence:"low",detectionMethod:"none",detectedAt:new Date().toISOString()},u);o.aiData=y,o.aiJourneyAnalytics=J(o,y)}if(o.formDetails||(o.formDetails={formId:"",formName:"",firstName:"",lastName:"",email:"",phone:""}),o.device||(o.device=i()),!o){console.error("Journey initialization failed"),r(null);return}let f=window.location.pathname,P=new Date().toISOString(),I=o.userJourney[o.userJourney.length-1];if(I&&I.page===f)I.time=P;else{let y=o.userJourney.length===0,T=y?void 0:o.userJourney[0].utm,C=y&&u.platform!=="none",v=o.aiData.platform!=="none",S={touchPoint:o.userJourney.length+1,page:f,title:document.title||"Untitled",type:c(f),category:p(),time:P,utmVisibility:d()?"visible":"hidden",utm:g(y,T),aiContext:{isAIReferral:C,aiPlatform:v?u.platform:void 0,aiInfluenced:v,aiJourneyStage:C?"entry":o.userJourney.length===0?"exploration":f.includes("pricing")||f.includes("contact")?"decision":"consideration"}};o.userJourney.push(S)}o.aiJourneyAnalytics=J(o,o.aiData),sessionStorage.setItem(e,JSON.stringify(o)),_(),o.aiData.platform!=="none"&&E(o,f),r(o)}catch(u){console.error("Error tracking user journey:",u),r(null)}},200)})}function E(e,t){let n=e.aiData,a=new URL(window.location.href),i={ai_platform:n.platform,ai_type:n.type,ai_context:n.context,ai_confidence:n.confidence,detection_method:n.detectionMethod,landing_page:t,page_category:L(t),utm_source:a.searchParams.get("utm_source")||"",utm_medium:a.searchParams.get("utm_medium")||"",utm_campaign:a.searchParams.get("utm_campaign")||"",utm_content:a.searchParams.get("utm_content")||"",utm_term:a.searchParams.get("utm_term")||"",is_ai_user:e.aiJourneyAnalytics.isAIUser,ai_touchpoints:e.aiJourneyAnalytics.aiTouchPoints,session_start:n.detectedAt};console.debug("AI tracking event data:",i)}function L(e){return e==="/"?"Homepage":e.includes("/platform")?"Platform":e.includes("/solutions")?"Solutions":e.includes("/blog")?"Blog":e.includes("/developers")||e.includes("/api")?"Developer":e.includes("/contact")||e.includes("/demo")?"Contact":e.includes("/pricing")?"Pricing":e.includes("/about")||e.includes("/company")?"Company":"Other"}function _(){document.querySelectorAll("input[ph-form-field], textarea[ph-form-field], select[ph-form-field]").forEach(n=>{n.removeEventListener("input",w),n.removeEventListener("change",w)}),document.querySelectorAll("input[ph-form-field], textarea[ph-form-field], select[ph-form-field]").forEach(n=>{n.addEventListener("input",w),n.addEventListener("change",w)}),O()}function O(){let e=l();if(!e)return;let t=document.querySelector("[ph-form-name]");if(!t)return;let n=t.getAttribute("ph-form-name"),a=t.getAttribute("ph-form-id")||"form-1";n&&(e.formDetails.formName||(e.formDetails.formId=a,e.formDetails.formName=n),sessionStorage.setItem("userJourney",JSON.stringify(e)))}function w(e){let t=e.target,n=t.getAttribute("ph-form-field");if(!n)return;let a=t.closest("[ph-form-name]");if(!a)return;let i=a.getAttribute("ph-form-name"),s=a.getAttribute("ph-form-id")||"form-1";i&&V(i,s,n,t.value)}function V(e,t,n,a){try{let i=l();if(!i)return!1;switch(i.formDetails.formId=t,i.formDetails.formName=e,n){case"firstName":i.formDetails.firstName=a;break;case"lastName":i.formDetails.lastName=a;break;case"email":i.formDetails.email=a;break;case"phone":i.formDetails.phone=a;break;default:return console.warn(`Unknown field: ${n}`),!1}return sessionStorage.setItem("userJourney",JSON.stringify(i)),!0}catch(i){return console.error("Error updating form data:",i),!1}}function l(){try{let e=sessionStorage.getItem("userJourney");return e?JSON.parse(e):null}catch(e){return console.error("Error getting user journey:",e),null}}function R(){sessionStorage.removeItem("userJourney")}function B(e){try{let t=l();if(!t||t.userJourney.length===0)return!1;let n=t.userJourney[t.userJourney.length-1];return n.category=e.length>0?e:["Not applicable"],sessionStorage.setItem("userJourney",JSON.stringify(t)),!0}catch(t){return console.error("Error updating page categories:",t),!1}}function q(e){try{let t=l();if(!t||t.userJourney.length===0)return!1;let n=t.userJourney[t.userJourney.length-1];return n.type=e,sessionStorage.setItem("userJourney",JSON.stringify(t)),!0}catch(t){return console.error("Error updating page type:",t),!1}}function W(){let e=l();if(!e||e.userJourney.length===0)return null;let t=e.userJourney[0],n=e.userJourney[e.userJourney.length-1],a=new Date(n.time).getTime()-new Date(t.time).getTime(),i;if(e.aiJourneyAnalytics.isAIUser){let s=e.userJourney.find(c=>c.aiContext?.isAIReferral),g=s?new Date(s.time):new Date(t.time),p=new Date(n.time).getTime()-g.getTime(),d=e.userJourney.some(c=>c.page.includes("contact")||c.page.includes("demo")||c.page.includes("pricing"));i={aiSessionDuration:Math.floor(p/1e3),aiPages:e.aiJourneyAnalytics.aiTouchPoints,aiConversionTime:d?Math.floor(p/1e3):void 0,aiEngagementScore:G(e),aiValueScore:H(e)}}return{totalPages:e.userJourney.length,sessionDuration:Math.floor(a/1e3),firstPage:t.page,lastPage:n.page,aiStats:i}}function G(e){let t=0;e.aiJourneyAnalytics.isAIUser&&(t+=20);let n=e.userJourney.length;n>=5?t+=30:n>=3?t+=20:n>=2&&(t+=10);let a=e.aiJourneyAnalytics.behaviorPatterns;return a.researchIntensive&&(t+=25),a.technicalFocus&&(t+=20),a.quickDecision&&(t+=15),e.userJourney.some(s=>s.type.toLowerCase().includes("solution")||s.type.toLowerCase().includes("pricing")||s.type.toLowerCase().includes("demo"))&&(t+=15),Math.min(t,100)}function H(e){let t=0;e.aiData.confidence==="high"?t+=20:e.aiData.confidence==="medium"&&(t+=10),["ChatGPT","Claude","Google_Gemini"].includes(e.aiData.platform)&&(t+=15);let a=e.userJourney.map(s=>s.page.toLowerCase());return a.some(s=>s.includes("pricing"))&&(t+=25),a.some(s=>s.includes("contact")||s.includes("demo"))&&(t+=30),a.some(s=>s.includes("api")||s.includes("developer"))&&(t+=20),(e.formDetails.email||e.formDetails.firstName)&&(t+=20),Math.min(t,100)}function $(){let e=l();return e?e.formDetails:null}function z(e){let t=l();return t&&t.formDetails[e]||null}function Y(e,t){try{let n=l();return n?(n.formDetails[e]=t,sessionStorage.setItem("userJourney",JSON.stringify(n)),!0):!1}catch(n){return console.error("Error setting form data:",n),!1}}function Q(e,t){try{let n=l();return n?(n.formDetails.formId=e,n.formDetails.formName=t,sessionStorage.setItem("userJourney",JSON.stringify(n)),!0):!1}catch(n){return console.error("Error setting form details:",n),!1}}function K(){_()}function X(){let e=l();return e?e.aiData:null}function Z(){let e=l();return e?e.aiJourneyAnalytics:null}function j(){let e=l();return e?e.aiJourneyAnalytics.isAIUser:!1}function ee(){let e=l();return e&&e.aiData.platform!=="none"?e.aiData.platform:null}function te(){let e=D(),t=l();return t&&(t.aiData=e,t.aiJourneyAnalytics=J(t,e),sessionStorage.setItem("userJourney",JSON.stringify(t))),e}document.addEventListener("DOMContentLoaded",()=>{A()});document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{A()}):A();window.trackUserJourney=A;window.getUserJourney=l;window.clearUserJourney=R;window.updatePageType=q;window.updatePageCategories=B;window.getJourneyStats=W;window.getFormData=$;window.getFormFieldValue=z;window.setFormData=Y;window.setFormDetails=Q;window.reinitializeFormTracking=K;window.getAIData=X;window.getAIJourneyAnalytics=Z;window.isAIUser=j;window.getAIPlatform=ee;window.forceAIDetection=te;window.detectAIPlatform=D;})();
|
|
1
|
+
"use strict";(()=>{function U(e,t){return t.platform!=="none"?t:e}function D(){let t=document.referrer.toLowerCase(),n=new URL(window.location.href),a=n.searchParams.get("utm_source")?.toLowerCase()||"",i=n.searchParams.get("utm_medium")?.toLowerCase()||"",s=n.searchParams.get("utm_campaign")?.toLowerCase()||"",g=n.searchParams.get("utm_content")?.toLowerCase()||"",p=`${t} ${a} ${i} ${s} ${g}`,d={platform:"none",type:"unknown",context:"unknown",confidence:"low",detectionMethod:"none",detectedAt:new Date().toISOString()},c=[{keywords:["chatgpt","openai","chat.openai"],platform:"ChatGPT",type:"ai_chat",context:"conversational_query",confidence:"high"},{keywords:["perplexity"],platform:"Perplexity",type:"ai_search",context:"research_query",confidence:"high"},{keywords:["claude","anthropic"],platform:"Claude",type:"ai_chat",context:"conversational_query",confidence:"high"},{keywords:["bing","copilot","microsoft-copilot"],platform:"Bing_Copilot",type:"ai_chat",context:"conversational_query",confidence:"medium"},{keywords:["gemini","bard","google-ai"],platform:"Google_Gemini",type:"ai_chat",context:"conversational_query",confidence:"high"},{keywords:["you.com","you-ai"],platform:"You_AI",type:"ai_search",context:"search_query",confidence:"medium"},{keywords:["character.ai","character"],platform:"Character_AI",type:"ai_chat",context:"character_interaction",confidence:"high"},{keywords:["poe","quora-poe"],platform:"Poe",type:"ai_chat",context:"conversational_query",confidence:"high"},{keywords:["huggingface","hf-chat"],platform:"HuggingFace",type:"ai_chat",context:"technical_query",confidence:"medium"},{keywords:["replika"],platform:"Replika",type:"ai_chat",context:"personal_assistant",confidence:"high"}];for(let h of c){let r=h.keywords.find(u=>p.includes(u));if(r){d={platform:h.platform,type:h.type,context:h.context,confidence:h.confidence,detectionMethod:x(r,t,a,i),detectedAt:new Date().toISOString()};break}}return d.platform==="none"&&(d=b(a,i,s,g)),d}function x(e,t,n,a){return t.includes(e)?"referrer":n.includes(e)?"utm_source":a.includes(e)?"utm_medium":"utm_other"}function b(e,t,n,a){let i=[{condition:t.includes("ai")||t.includes("chat"),platform:"AI_Generic",type:"ai_unknown",context:"utm_tagged",confidence:"medium"},{condition:n.includes("ai-assistant")||n.includes("chatbot"),platform:"AI_Campaign",type:"ai_chat",context:"campaign_driven",confidence:"medium"},{condition:a.includes("ai-generated")||a.includes("llm"),platform:"AI_Content",type:"ai_content",context:"content_discovery",confidence:"medium"}];for(let s of i)if(s.condition)return{platform:s.platform,type:s.type,context:s.context,confidence:s.confidence,detectionMethod:"utm_pattern",detectedAt:new Date().toISOString()};return{platform:"none",type:"unknown",context:"unknown",confidence:"low",detectionMethod:"none",detectedAt:new Date().toISOString()}}function J(e,t){let n=t.platform!=="none";if(!n)return{isAIUser:!1,aiTouchPoints:0,aiEntryPage:null,behaviorPatterns:{skipsBranding:!1,researchIntensive:!1,quickDecision:!1,technicalFocus:!1},platformInsights:{expectedJourney:"n/a",actualVsPredicted:"matched",platformTypicalBehavior:"n/a"}};let a=e.userJourney.find(c=>c.aiContext?.isAIReferral)?.page||e.userJourney[0]?.page||null,i=e.userJourney.filter(c=>c.aiContext?.aiInfluenced).length,s=e.userJourney.map(c=>c.page.toLowerCase()),g=e.userJourney.map(c=>c.type.toLowerCase()),p={skipsBranding:!s.some(c=>c.includes("about")||c==="/")&&s.length>1,researchIntensive:e.userJourney.length>5||g.filter(c=>c.includes("solution")||c.includes("blog")).length>2,quickDecision:s.some(c=>c.includes("contact")||c.includes("demo")||c.includes("pricing"))&&e.userJourney.length<=3,technicalFocus:g.some(c=>c.toLowerCase().includes("api")||c.toLowerCase().includes("developer"))||s.some(c=>c.includes("api")||c.includes("developer"))},d={expectedJourney:k(t.platform,a),actualVsPredicted:F(e,t.platform),platformTypicalBehavior:M(t.platform)};return{isAIUser:n,aiTouchPoints:i,aiEntryPage:a,aiConversionPath:s,aiSessionDuration:N(e),aiPageDepth:e.userJourney.length,behaviorPatterns:p,platformInsights:d}}function k(e,t){return{ChatGPT:"solutions_exploration",Perplexity:"research_deep_dive",Claude:"technical_evaluation",Bing_Copilot:"quick_overview",Google_Gemini:"comparative_analysis"}[e]||"general_exploration"}function F(e,t){let n=e.userJourney.length;return e.userJourney.some(i=>i.page.includes("contact")||i.page.includes("demo")||i.page.includes("pricing"))&&n>=3?"exceeded":n>=2?"matched":"underperformed"}function M(e){return{ChatGPT:"Direct to solutions, conversion-focused",Perplexity:"Research-heavy, multiple page views",Claude:"Technical documentation focus",Bing_Copilot:"Quick overview, efficiency-focused",Google_Gemini:"Comparative analysis, thorough evaluation"}[e]||"General exploration pattern"}function N(e){if(e.userJourney.length<2)return 0;let t=new Date(e.userJourney[0].time),n=new Date(e.userJourney[e.userJourney.length-1].time);return Math.floor((n.getTime()-t.getTime())/1e3)}async function A(){let e="userJourney";function n(){let r=navigator.userAgent;return/tablet|ipad|playbook|silk/i.test(r)?"Tablet":/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(r)?"Mobile":"Desktop"}function a(){let r=navigator.userAgent;return r.includes("Chrome")&&!r.includes("Edg")?"Chrome":r.includes("Firefox")?"Firefox":r.includes("Safari")&&!r.includes("Chrome")?"Safari":r.includes("Edg")?"Edge":r.includes("Opera")?"Opera":"Unknown"}function i(){let r=navigator.userAgent;if(/iPhone/.test(r)){let o=r.match(/iPhone\s*([^;]*)/);return o?`iPhone ${o[1].trim()}`:"iPhone"}if(/iPad/.test(r)){let o=r.match(/iPad\s*([^;]*)/);return o?`iPad ${o[1].trim()}`:"iPad"}if(/Android/.test(r)){let o=r.match(/;\s*([^)]*)\s*\)/);return o&&o[1].trim().replace(/wv/g,"").replace(/Build\/.*$/g,"").replace(/\s+/g," ").trim()||"Android Device"}return/Windows/.test(r)?/Windows NT 10/.test(r)?"Windows 10/11 PC":/Windows NT 6\.3/.test(r)?"Windows 8.1 PC":/Windows NT 6\.2/.test(r)?"Windows 8 PC":/Windows NT 6\.1/.test(r)?"Windows 7 PC":"Windows PC":/Macintosh/.test(r)?/Intel/.test(r)?"Mac (Intel)":/Apple Silicon|ARM64/.test(r)?"Mac (Apple Silicon)":"Mac":/Linux/.test(r)?"Linux PC":/BlackBerry/.test(r)?"BlackBerry":/Windows Phone/.test(r)?"Windows Phone":n().charAt(0).toUpperCase()}function s(r){if(!r)return"Unknown";try{let m=new URL(r).hostname.replace(/^www\./,""),f=m.split(".");return f.length>=2?f[0]:m||"Unknown"}catch{return"Unknown"}}function g(r,u){let o=new URLSearchParams(window.location.search),m=o.has("utm_source")||o.has("utm_medium")||o.has("utm_campaign");return r||m?m?{source:o.get("utm_source")||"",medium:o.get("utm_medium")||"",campaign:o.get("utm_campaign")||"",content:o.get("utm_content")||"",term:o.get("utm_term")||""}:{source:s(document.referrer),medium:"organic",campaign:"unknown"}:u||{source:"Unknown",medium:"organic",campaign:"unknown"}}function p(){try{return typeof window.pageCategories<"u"&&Array.isArray(window.pageCategories)&&window.pageCategories.length>0?window.pageCategories:["Not applicable"]}catch(r){return console.warn("Error accessing pageCategories:",r),["Not applicable"]}}function d(){let r=new URLSearchParams(window.location.search);return r.has("utm_source")||r.has("utm_medium")||r.has("utm_campaign")}function c(r){let u=r.split("?")[0].toLowerCase(),o={exactMatches:{"/":"Home","/home":"Home","/blog":"Blog listing","/about-us":"About us","/contact-us":"Contact","/privacy-policy":"Privacy policy","/terms-of-service":"Terms of service","/careers":"Careers","/customer-stories":"Customer stories listing","/events":"Events listing","/infographics":"Infographics listing","/newsroom":"Newsroom","/releases":"Releases listing"},pathStartsWith:[{pattern:"/blog/",type:"Blog"},{pattern:"/customer-stories/",type:"Customer story"},{pattern:"/case-studies/",type:"Case study"},{pattern:"/solutions/",type:"Solution"},{pattern:"/events/",type:"Event"},{pattern:"/news/",type:"News"},{pattern:"/press-releases/",type:"Press release"},{pattern:"/releases/",type:"Release"}]};if(o.exactMatches[u])return o.exactMatches[u];for(let m of o.pathStartsWith)if(u.startsWith(m.pattern))return m.type;return"Other"}function h(r){if(!r.userJourney||r.userJourney.length===0)return!1;let u=new Date(r.userJourney[r.userJourney.length-1].time);return new Date().getTime()-u.getTime()<18e5}return new Promise(r=>{setTimeout(()=>{try{let u=D(),o=null,m=localStorage.getItem(e);if(m){let y=JSON.parse(m);h(y)&&(o=y)}if(!o)o={userJourney:[],origin:window.location.hostname,deviceCategory:n(),browser:a(),device:i(),formDetails:{formId:"",formName:"",firstName:"",lastName:"",email:"",phone:""},aiData:u,aiJourneyAnalytics:{isAIUser:!1,aiTouchPoints:0,aiEntryPage:null,behaviorPatterns:{skipsBranding:!1,researchIntensive:!1,quickDecision:!1,technicalFocus:!1},platformInsights:{expectedJourney:"n/a",actualVsPredicted:"matched",platformTypicalBehavior:"n/a"}}};else{let y=U(o.aiData||{platform:"none",type:"unknown",context:"unknown",confidence:"low",detectionMethod:"none",detectedAt:new Date().toISOString()},u);o.aiData=y,o.aiJourneyAnalytics=J(o,y)}if(o.formDetails||(o.formDetails={formId:"",formName:"",firstName:"",lastName:"",email:"",phone:""}),o.device||(o.device=i()),!o){console.error("Journey initialization failed"),r(null);return}let f=window.location.pathname,P=new Date().toISOString(),I=o.userJourney[o.userJourney.length-1];if(I&&I.page===f)I.time=P;else{let y=o.userJourney.length===0,T=y?void 0:o.userJourney[0].utm,C=y&&u.platform!=="none",v=o.aiData.platform!=="none",S={touchPoint:o.userJourney.length+1,page:f,title:document.title||"Untitled",type:c(f),category:p(),time:P,utmVisibility:d()?"visible":"hidden",utm:g(y,T),aiContext:{isAIReferral:C,aiPlatform:v?u.platform:void 0,aiInfluenced:v,aiJourneyStage:C?"entry":o.userJourney.length===0?"exploration":f.includes("pricing")||f.includes("contact")?"decision":"consideration"}};o.userJourney.push(S)}o.aiJourneyAnalytics=J(o,o.aiData),localStorage.setItem(e,JSON.stringify(o)),_(),o.aiData.platform!=="none"&&E(o,f),r(o)}catch(u){console.error("Error tracking user journey:",u),r(null)}},200)})}function E(e,t){let n=e.aiData,a=new URL(window.location.href),i={ai_platform:n.platform,ai_type:n.type,ai_context:n.context,ai_confidence:n.confidence,detection_method:n.detectionMethod,landing_page:t,page_category:L(t),utm_source:a.searchParams.get("utm_source")||"",utm_medium:a.searchParams.get("utm_medium")||"",utm_campaign:a.searchParams.get("utm_campaign")||"",utm_content:a.searchParams.get("utm_content")||"",utm_term:a.searchParams.get("utm_term")||"",is_ai_user:e.aiJourneyAnalytics.isAIUser,ai_touchpoints:e.aiJourneyAnalytics.aiTouchPoints,session_start:n.detectedAt};console.debug("AI tracking event data:",i)}function L(e){return e==="/"?"Homepage":e.includes("/platform")?"Platform":e.includes("/solutions")?"Solutions":e.includes("/blog")?"Blog":e.includes("/developers")||e.includes("/api")?"Developer":e.includes("/contact")||e.includes("/demo")?"Contact":e.includes("/pricing")?"Pricing":e.includes("/about")||e.includes("/company")?"Company":"Other"}function _(){document.querySelectorAll("input[ph-form-field], textarea[ph-form-field], select[ph-form-field]").forEach(n=>{n.removeEventListener("input",w),n.removeEventListener("change",w)}),document.querySelectorAll("input[ph-form-field], textarea[ph-form-field], select[ph-form-field]").forEach(n=>{n.addEventListener("input",w),n.addEventListener("change",w)}),O()}function O(){let e=l();if(!e)return;let t=document.querySelector("[ph-form-name]");if(!t)return;let n=t.getAttribute("ph-form-name"),a=t.getAttribute("ph-form-id")||"form-1";n&&(e.formDetails.formName||(e.formDetails.formId=a,e.formDetails.formName=n),localStorage.setItem("userJourney",JSON.stringify(e)))}function w(e){let t=e.target,n=t.getAttribute("ph-form-field");if(!n)return;let a=t.closest("[ph-form-name]");if(!a)return;let i=a.getAttribute("ph-form-name"),s=a.getAttribute("ph-form-id")||"form-1";i&&V(i,s,n,t.value)}function V(e,t,n,a){try{let i=l();if(!i)return!1;switch(i.formDetails.formId=t,i.formDetails.formName=e,n){case"firstName":i.formDetails.firstName=a;break;case"lastName":i.formDetails.lastName=a;break;case"email":i.formDetails.email=a;break;case"phone":i.formDetails.phone=a;break;default:return console.warn(`Unknown field: ${n}`),!1}return localStorage.setItem("userJourney",JSON.stringify(i)),!0}catch(i){return console.error("Error updating form data:",i),!1}}function l(){try{let e=localStorage.getItem("userJourney");return e?JSON.parse(e):null}catch(e){return console.error("Error getting user journey:",e),null}}function R(){localStorage.removeItem("userJourney")}function B(e){try{let t=l();if(!t||t.userJourney.length===0)return!1;let n=t.userJourney[t.userJourney.length-1];return n.category=e.length>0?e:["Not applicable"],localStorage.setItem("userJourney",JSON.stringify(t)),!0}catch(t){return console.error("Error updating page categories:",t),!1}}function q(e){try{let t=l();if(!t||t.userJourney.length===0)return!1;let n=t.userJourney[t.userJourney.length-1];return n.type=e,localStorage.setItem("userJourney",JSON.stringify(t)),!0}catch(t){return console.error("Error updating page type:",t),!1}}function W(){let e=l();if(!e||e.userJourney.length===0)return null;let t=e.userJourney[0],n=e.userJourney[e.userJourney.length-1],a=new Date(n.time).getTime()-new Date(t.time).getTime(),i;if(e.aiJourneyAnalytics.isAIUser){let s=e.userJourney.find(c=>c.aiContext?.isAIReferral),g=s?new Date(s.time):new Date(t.time),p=new Date(n.time).getTime()-g.getTime(),d=e.userJourney.some(c=>c.page.includes("contact")||c.page.includes("demo")||c.page.includes("pricing"));i={aiSessionDuration:Math.floor(p/1e3),aiPages:e.aiJourneyAnalytics.aiTouchPoints,aiConversionTime:d?Math.floor(p/1e3):void 0,aiEngagementScore:G(e),aiValueScore:H(e)}}return{totalPages:e.userJourney.length,sessionDuration:Math.floor(a/1e3),firstPage:t.page,lastPage:n.page,aiStats:i}}function G(e){let t=0;e.aiJourneyAnalytics.isAIUser&&(t+=20);let n=e.userJourney.length;n>=5?t+=30:n>=3?t+=20:n>=2&&(t+=10);let a=e.aiJourneyAnalytics.behaviorPatterns;return a.researchIntensive&&(t+=25),a.technicalFocus&&(t+=20),a.quickDecision&&(t+=15),e.userJourney.some(s=>s.type.toLowerCase().includes("solution")||s.type.toLowerCase().includes("pricing")||s.type.toLowerCase().includes("demo"))&&(t+=15),Math.min(t,100)}function H(e){let t=0;e.aiData.confidence==="high"?t+=20:e.aiData.confidence==="medium"&&(t+=10),["ChatGPT","Claude","Google_Gemini"].includes(e.aiData.platform)&&(t+=15);let a=e.userJourney.map(s=>s.page.toLowerCase());return a.some(s=>s.includes("pricing"))&&(t+=25),a.some(s=>s.includes("contact")||s.includes("demo"))&&(t+=30),a.some(s=>s.includes("api")||s.includes("developer"))&&(t+=20),(e.formDetails.email||e.formDetails.firstName)&&(t+=20),Math.min(t,100)}function $(){let e=l();return e?e.formDetails:null}function z(e){let t=l();return t&&t.formDetails[e]||null}function Y(e,t){try{let n=l();return n?(n.formDetails[e]=t,localStorage.setItem("userJourney",JSON.stringify(n)),!0):!1}catch(n){return console.error("Error setting form data:",n),!1}}function Q(e,t){try{let n=l();return n?(n.formDetails.formId=e,n.formDetails.formName=t,localStorage.setItem("userJourney",JSON.stringify(n)),!0):!1}catch(n){return console.error("Error setting form details:",n),!1}}function K(){_()}function X(){let e=l();return e?e.aiData:null}function Z(){let e=l();return e?e.aiJourneyAnalytics:null}function j(){let e=l();return e?e.aiJourneyAnalytics.isAIUser:!1}function ee(){let e=l();return e&&e.aiData.platform!=="none"?e.aiData.platform:null}function te(){let e=D(),t=l();return t&&(t.aiData=e,t.aiJourneyAnalytics=J(t,e),localStorage.setItem("userJourney",JSON.stringify(t))),e}document.addEventListener("DOMContentLoaded",()=>{A()});document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{A()}):A();window.trackUserJourney=A;window.getUserJourney=l;window.clearUserJourney=R;window.updatePageType=q;window.updatePageCategories=B;window.getJourneyStats=W;window.getFormData=$;window.getFormFieldValue=z;window.setFormData=Y;window.setFormDetails=Q;window.reinitializeFormTracking=K;window.getAIData=X;window.getAIJourneyAnalytics=Z;window.isAIUser=j;window.getAIPlatform=ee;window.forceAIDetection=te;window.detectAIPlatform=D;})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/tracking/user-journey.ts"],
|
|
4
|
-
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// userJourney.ts - Enhanced with AI Detection\nimport {\n UTMParameters,\n TouchPoint,\n UserJourney,\n DeviceCategory,\n UTMVisibility,\n JourneyStats,\n FormDetails,\n AIData,\n AIPlatform,\n AIType,\n AIContext,\n AIDetectionMethod\n} from '../utils/types/user-journey';\n\nexport { };\n\n// Strategy 2: Use Latest Platform (Most recent AI influence)\nfunction handleAIDetection_LatestPlatform(existingAIData: AIData, newAIData: AIData): AIData {\n // Always use the most recent AI detection\n if (newAIData.platform !== 'none') {\n return newAIData;\n }\n \n // Keep existing if no new AI detected\n return existingAIData;\n}\n\n// AI Detection Functions\nfunction detectAIPlatform(): AIData {\n const referrerObj = document.referrer;\n const referrer = referrerObj.toLowerCase();\n const currentURL = new URL(window.location.href);\n \n // Extract UTM parameters\n const utmSource = currentURL.searchParams.get('utm_source')?.toLowerCase() || '';\n const utmMedium = currentURL.searchParams.get('utm_medium')?.toLowerCase() || '';\n const utmCampaign = currentURL.searchParams.get('utm_campaign')?.toLowerCase() || '';\n const utmContent = currentURL.searchParams.get('utm_content')?.toLowerCase() || '';\n \n // Combine all sources for detection\n const allSources = `${referrer} ${utmSource} ${utmMedium} ${utmCampaign} ${utmContent}`;\n \n let aiData: AIData = {\n platform: 'none',\n type: 'unknown',\n context: 'unknown',\n confidence: 'low',\n detectionMethod: 'none',\n detectedAt: new Date().toISOString()\n };\n \n // AI Platform Detection with keyword matching\n const aiPlatforms = [\n {\n keywords: ['chatgpt', 'openai', 'chat.openai'],\n platform: 'ChatGPT' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['perplexity'],\n platform: 'Perplexity' as AIPlatform,\n type: 'ai_search' as AIType,\n context: 'research_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['claude', 'anthropic'],\n platform: 'Claude' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['bing', 'copilot', 'microsoft-copilot'],\n platform: 'Bing_Copilot' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'medium' as const\n },\n {\n keywords: ['gemini', 'bard', 'google-ai'],\n platform: 'Google_Gemini' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['you.com', 'you-ai'],\n platform: 'You_AI' as AIPlatform,\n type: 'ai_search' as AIType,\n context: 'search_query' as AIContext,\n confidence: 'medium' as const\n },\n {\n keywords: ['character.ai', 'character'],\n platform: 'Character_AI' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'character_interaction' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['poe', 'quora-poe'],\n platform: 'Poe' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['huggingface', 'hf-chat'],\n platform: 'HuggingFace' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'technical_query' as AIContext,\n confidence: 'medium' as const\n },\n {\n keywords: ['replika'],\n platform: 'Replika' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'personal_assistant' as AIContext,\n confidence: 'high' as const\n }\n ];\n \n // Check for AI platform matches\n for (const platform of aiPlatforms) {\n const matchedKeyword = platform.keywords.find(keyword => \n allSources.includes(keyword)\n );\n \n if (matchedKeyword) {\n aiData = {\n platform: platform.platform,\n type: platform.type,\n context: platform.context,\n confidence: platform.confidence,\n detectionMethod: getDetectionMethod(matchedKeyword, referrer, utmSource, utmMedium),\n detectedAt: new Date().toISOString()\n };\n break;\n }\n }\n \n // Enhanced detection for specific UTM patterns\n if (aiData.platform === 'none') {\n aiData = detectFromUTMPatterns(utmSource, utmMedium, utmCampaign, utmContent);\n }\n \n return aiData;\n}\n\n// Determine how the AI platform was detected\nfunction getDetectionMethod(matchedKeyword: string, referrer: string, utmSource: string, utmMedium: string): AIDetectionMethod {\n if (referrer.includes(matchedKeyword)) {\n return 'referrer';\n } else if (utmSource.includes(matchedKeyword)) {\n return 'utm_source';\n } else if (utmMedium.includes(matchedKeyword)) {\n return 'utm_medium';\n }\n return 'utm_other';\n}\n\n// Specific UTM pattern detection for AI platforms\nfunction detectFromUTMPatterns(utmSource: string, utmMedium: string, utmCampaign: string, utmContent: string): AIData {\n const aiUTMPatterns = [\n {\n condition: utmMedium.includes('ai') || utmMedium.includes('chat'),\n platform: 'AI_Generic' as AIPlatform,\n type: 'ai_unknown' as AIType,\n context: 'utm_tagged' as AIContext,\n confidence: 'medium' as const\n },\n {\n condition: utmCampaign.includes('ai-assistant') || utmCampaign.includes('chatbot'),\n platform: 'AI_Campaign' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'campaign_driven' as AIContext,\n confidence: 'medium' as const\n },\n {\n condition: utmContent.includes('ai-generated') || utmContent.includes('llm'),\n platform: 'AI_Content' as AIPlatform,\n type: 'ai_content' as AIType,\n context: 'content_discovery' as AIContext,\n confidence: 'medium' as const\n }\n ];\n \n for (const pattern of aiUTMPatterns) {\n if (pattern.condition) {\n return {\n platform: pattern.platform,\n type: pattern.type,\n context: pattern.context,\n confidence: pattern.confidence,\n detectionMethod: 'utm_pattern',\n detectedAt: new Date().toISOString()\n };\n }\n }\n \n return {\n platform: 'none',\n type: 'unknown',\n context: 'unknown',\n confidence: 'low',\n detectionMethod: 'none',\n detectedAt: new Date().toISOString()\n };\n}\n\n// AI Journey Analytics Functions\nfunction calculateAIJourneyAnalytics(journey: UserJourney, aiData: AIData): UserJourney['aiJourneyAnalytics'] {\n const isAIUser = aiData.platform !== 'none';\n \n if (!isAIUser) {\n return {\n isAIUser: false,\n aiTouchPoints: 0,\n aiEntryPage: null,\n behaviorPatterns: {\n skipsBranding: false,\n researchIntensive: false,\n quickDecision: false,\n technicalFocus: false\n },\n platformInsights: {\n expectedJourney: 'n/a',\n actualVsPredicted: 'matched',\n platformTypicalBehavior: 'n/a'\n }\n };\n }\n \n const aiEntryPage = journey.userJourney.find(tp => tp.aiContext?.isAIReferral)?.page || journey.userJourney[0]?.page || null;\n const aiTouchPoints = journey.userJourney.filter(tp => tp.aiContext?.aiInfluenced).length;\n \n // Analyze behavior patterns\n const pages = journey.userJourney.map(tp => tp.page.toLowerCase());\n const pageTypes = journey.userJourney.map(tp => tp.type.toLowerCase());\n \n const behaviorPatterns = {\n skipsBranding: !pages.some(p => p.includes('about') || p === '/') && pages.length > 1,\n researchIntensive: journey.userJourney.length > 5 || pageTypes.filter(t => t.includes('solution') || t.includes('blog')).length > 2,\n quickDecision: pages.some(p => p.includes('contact') || p.includes('demo') || p.includes('pricing')) && journey.userJourney.length <= 3,\n technicalFocus: pageTypes.some(t => t.toLowerCase().includes('api') || t.toLowerCase().includes('developer')) || pages.some(p => p.includes('api') || p.includes('developer'))\n };\n \n // Platform-specific insights\n const platformInsights = {\n expectedJourney: predictExpectedJourney(aiData.platform, aiEntryPage),\n actualVsPredicted: evaluateJourneyPerformance(journey, aiData.platform),\n platformTypicalBehavior: getPlatformTypicalBehavior(aiData.platform)\n };\n \n return {\n isAIUser,\n aiTouchPoints,\n aiEntryPage,\n aiConversionPath: pages,\n aiSessionDuration: calculateSessionDuration(journey),\n aiPageDepth: journey.userJourney.length,\n behaviorPatterns,\n platformInsights\n };\n}\n\nfunction predictExpectedJourney(platform: string, entryPage: string | null): string {\n const platformJourneys: Record<string, string> = {\n 'ChatGPT': 'solutions_exploration',\n 'Perplexity': 'research_deep_dive',\n 'Claude': 'technical_evaluation',\n 'Bing_Copilot': 'quick_overview',\n 'Google_Gemini': 'comparative_analysis'\n };\n \n return platformJourneys[platform] || 'general_exploration';\n}\n\nfunction evaluateJourneyPerformance(journey: UserJourney, platform: string): 'matched' | 'exceeded' | 'underperformed' {\n const pageCount = journey.userJourney.length;\n const hasConversion = journey.userJourney.some(tp => \n tp.page.includes('contact') || tp.page.includes('demo') || tp.page.includes('pricing')\n );\n \n // Simple heuristic - can be made more sophisticated\n if (hasConversion && pageCount >= 3) return 'exceeded';\n if (pageCount >= 2) return 'matched';\n return 'underperformed';\n}\n\nfunction getPlatformTypicalBehavior(platform: string): string {\n const behaviors: Record<string, string> = {\n 'ChatGPT': 'Direct to solutions, conversion-focused',\n 'Perplexity': 'Research-heavy, multiple page views',\n 'Claude': 'Technical documentation focus',\n 'Bing_Copilot': 'Quick overview, efficiency-focused',\n 'Google_Gemini': 'Comparative analysis, thorough evaluation'\n };\n \n return behaviors[platform] || 'General exploration pattern';\n}\n\nfunction calculateSessionDuration(journey: UserJourney): number {\n if (journey.userJourney.length < 2) return 0;\n \n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n \n return Math.floor((lastVisit.getTime() - firstVisit.getTime()) / 1000);\n}\n\nasync function trackUserJourney(): Promise<UserJourney | null> {\n const STORAGE_KEY: string = 'userJourney';\n const SESSION_TIMEOUT: number = 30 * 60 * 1000; // 30 minutes\n\n // Helper function to get device category\n function getDeviceCategory(): DeviceCategory {\n const userAgent: string = navigator.userAgent;\n if (/tablet|ipad|playbook|silk/i.test(userAgent)) return 'Tablet';\n if (/mobile|iphone|ipod|android|blackberry|opera|mini|windows\\sce|palm|smartphone|iemobile/i.test(userAgent)) return 'Mobile';\n return 'Desktop';\n }\n\n // Helper function to get browser\n function getBrowser(): string {\n const userAgent: string = navigator.userAgent;\n if (userAgent.includes('Chrome') && !userAgent.includes('Edg')) return 'Chrome';\n if (userAgent.includes('Firefox')) return 'Firefox';\n if (userAgent.includes('Safari') && !userAgent.includes('Chrome')) return 'Safari';\n if (userAgent.includes('Edg')) return 'Edge';\n if (userAgent.includes('Opera')) return 'Opera';\n return 'Unknown';\n }\n\n // Helper function to get device name from user agent\n function getDeviceName(): string {\n const userAgent: string = navigator.userAgent;\n \n // Mobile devices\n if (/iPhone/.test(userAgent)) {\n const match = userAgent.match(/iPhone\\s*([^;]*)/);\n return match ? `iPhone ${match[1].trim()}` : 'iPhone';\n }\n \n if (/iPad/.test(userAgent)) {\n const match = userAgent.match(/iPad\\s*([^;]*)/);\n return match ? `iPad ${match[1].trim()}` : 'iPad';\n }\n \n if (/Android/.test(userAgent)) {\n const modelMatch = userAgent.match(/;\\s*([^)]*)\\s*\\)/);\n if (modelMatch) {\n const deviceInfo = modelMatch[1].trim();\n const cleanDevice = deviceInfo\n .replace(/wv/g, '')\n .replace(/Build\\/.*$/g, '')\n .replace(/\\s+/g, ' ')\n .trim();\n return cleanDevice || 'Android Device';\n }\n return 'Android Device';\n }\n \n // Desktop/Laptop detection\n if (/Windows/.test(userAgent)) {\n if (/Windows NT 10/.test(userAgent)) return 'Windows 10/11 PC';\n if (/Windows NT 6\\.3/.test(userAgent)) return 'Windows 8.1 PC';\n if (/Windows NT 6\\.2/.test(userAgent)) return 'Windows 8 PC';\n if (/Windows NT 6\\.1/.test(userAgent)) return 'Windows 7 PC';\n return 'Windows PC';\n }\n \n if (/Macintosh/.test(userAgent)) {\n if (/Intel/.test(userAgent)) return 'Mac (Intel)';\n if (/Apple Silicon|ARM64/.test(userAgent)) return 'Mac (Apple Silicon)';\n return 'Mac';\n }\n \n if (/Linux/.test(userAgent)) {\n return 'Linux PC';\n }\n \n if (/BlackBerry/.test(userAgent)) return 'BlackBerry';\n if (/Windows Phone/.test(userAgent)) return 'Windows Phone';\n \n const deviceCategory = getDeviceCategory();\n return deviceCategory.charAt(0).toUpperCase();\n }\n\n // Helper function to extract domain from referrer\n function extractDomainFromReferrer(referrer: string): string {\n if (!referrer) return 'Unknown';\n\n try {\n const url = new URL(referrer);\n const hostname = url.hostname;\n const domain = hostname.replace(/^www\\./, '');\n const domainParts = domain.split('.');\n if (domainParts.length >= 2) {\n return domainParts[0];\n }\n return domain || 'Unknown';\n } catch (error) {\n return 'Unknown';\n }\n }\n\n // Enhanced UTM parameters with AI detection context\n function getUTMParameters(isFirstVisit: boolean, firstVisitUTM?: UTMParameters): UTMParameters {\n const urlParams: URLSearchParams = new URLSearchParams(window.location.search);\n const hasCurrentUTM: boolean = urlParams.has('utm_source') || urlParams.has('utm_medium') || urlParams.has('utm_campaign');\n\n if (isFirstVisit || hasCurrentUTM) {\n if (hasCurrentUTM) {\n return {\n source: urlParams.get('utm_source') || '',\n medium: urlParams.get('utm_medium') || '',\n campaign: urlParams.get('utm_campaign') || '',\n content: urlParams.get('utm_content') || '',\n term: urlParams.get('utm_term') || ''\n };\n } else {\n const referrerDomain = extractDomainFromReferrer(document.referrer);\n return {\n source: referrerDomain,\n medium: 'organic',\n campaign: 'unknown'\n };\n }\n } else {\n return firstVisitUTM || {\n source: 'Unknown',\n medium: 'organic',\n campaign: 'unknown'\n };\n }\n }\n\n // Helper function to get page categories from global variable\n function getPageCategories(): string[] {\n try {\n if (typeof (window as any).pageCategories !== 'undefined' &&\n Array.isArray((window as any).pageCategories) &&\n (window as any).pageCategories.length > 0) {\n return (window as any).pageCategories;\n }\n return ['Not applicable'];\n } catch (error) {\n console.warn('Error accessing pageCategories:', error);\n return ['Not applicable'];\n }\n }\n\n function hasVisibleUTM(): boolean {\n const urlParams: URLSearchParams = new URLSearchParams(window.location.search);\n return urlParams.has('utm_source') || urlParams.has('utm_medium') || urlParams.has('utm_campaign');\n }\n\n // Helper function to get page type (same as original)\n function getPageType(url: string): string {\n const path: string = url.split('?')[0].toLowerCase();\n\n const typeConfig = {\n exactMatches: {\n '/': 'Home',\n '/home': 'Home',\n '/blog': 'Blog listing',\n '/about-us': 'About us',\n '/contact-us': 'Contact',\n '/privacy-policy': 'Privacy policy',\n '/terms-of-service': 'Terms of service',\n '/careers': 'Careers',\n '/customer-stories': 'Customer stories listing',\n '/events': 'Events listing',\n '/infographics': 'Infographics listing',\n '/newsroom': 'Newsroom',\n '/releases': 'Releases listing',\n } as Record<string, string>,\n\n pathStartsWith: [\n { pattern: '/blog/', type: 'Blog' },\n { pattern: '/customer-stories/', type: 'Customer story' },\n { pattern: '/case-studies/', type: 'Case study' },\n { pattern: '/solutions/', type: 'Solution' },\n { pattern: '/events/', type: 'Event' },\n { pattern: '/news/', type: 'News' },\n { pattern: '/press-releases/', type: 'Press release' },\n { pattern: '/releases/', type: 'Release' },\n ]\n };\n\n if (typeConfig.exactMatches[path]) {\n return typeConfig.exactMatches[path];\n }\n\n for (const item of typeConfig.pathStartsWith) {\n if (path.startsWith(item.pattern)) {\n return item.type;\n }\n }\n\n return 'Other';\n }\n\n // Check if session is still valid\n function isValidSession(journey: UserJourney): boolean {\n if (!journey.userJourney || journey.userJourney.length === 0) return false;\n const lastVisit: Date = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n const now: Date = new Date();\n return (now.getTime() - lastVisit.getTime()) < SESSION_TIMEOUT;\n }\n\n // Add 200ms delay before executing the main logic\n return new Promise((resolve) => {\n setTimeout(() => {\n try {\n // Detect AI platform first\n const aiData = detectAIPlatform();\n \n // Get existing journey from sessionStorage\n let journey: UserJourney | null = null;\n const storedData: string | null = sessionStorage.getItem(STORAGE_KEY);\n\n if (storedData) {\n const parsedData: UserJourney = JSON.parse(storedData);\n if (isValidSession(parsedData)) {\n journey = parsedData;\n }\n }\n\n // Initialize new journey if none exists or session expired\n if (!journey) {\n journey = {\n userJourney: [],\n origin: window.location.hostname,\n deviceCategory: getDeviceCategory(),\n browser: getBrowser(),\n device: getDeviceName(),\n formDetails: {\n formId: '',\n formName: '',\n firstName: '',\n lastName: '',\n email: '',\n phone: ''\n },\n // Initialize AI data\n aiData: aiData,\n aiJourneyAnalytics: {\n isAIUser: false,\n aiTouchPoints: 0,\n aiEntryPage: null,\n behaviorPatterns: {\n skipsBranding: false,\n researchIntensive: false,\n quickDecision: false,\n technicalFocus: false\n },\n platformInsights: {\n expectedJourney: 'n/a',\n actualVsPredicted: 'matched',\n platformTypicalBehavior: 'n/a'\n }\n }\n };\n } else {\n // Update existing journey with AI data using latest platform strategy\n const updatedAIData = handleAIDetection_LatestPlatform(journey.aiData || {\n platform: 'none',\n type: 'unknown',\n context: 'unknown',\n confidence: 'low',\n detectionMethod: 'none',\n detectedAt: new Date().toISOString()\n }, aiData);\n \n journey.aiData = updatedAIData;\n journey.aiJourneyAnalytics = calculateAIJourneyAnalytics(journey, updatedAIData);\n }\n\n // Ensure backward compatibility\n if (!journey.formDetails) {\n journey.formDetails = {\n formId: '',\n formName: '',\n firstName: '',\n lastName: '',\n email: '',\n phone: ''\n };\n }\n\n if (!journey.device) {\n journey.device = getDeviceName();\n }\n\n if (!journey) {\n console.error('Journey initialization failed');\n resolve(null);\n return;\n }\n\n // Get current page info\n const currentUrl: string = window.location.pathname;\n const currentTime: string = new Date().toISOString();\n\n // Check if this is the same page as the last visit\n const lastVisit: TouchPoint | undefined = journey.userJourney[journey.userJourney.length - 1];\n if (lastVisit && lastVisit.page === currentUrl) {\n lastVisit.time = currentTime;\n } else {\n // New page visit\n const isFirstVisit: boolean = journey.userJourney.length === 0;\n const firstVisitUTM: UTMParameters | undefined = isFirstVisit ? undefined : journey.userJourney[0].utm;\n\n // Determine AI context for this touchpoint\n const isAIReferral = isFirstVisit && aiData.platform !== 'none';\n const aiInfluenced = journey.aiData.platform !== 'none';\n\n const touchPoint: TouchPoint = {\n touchPoint: journey.userJourney.length + 1,\n page: currentUrl,\n title: document.title || 'Untitled',\n type: getPageType(currentUrl),\n category: getPageCategories(),\n time: currentTime,\n utmVisibility: hasVisibleUTM() ? 'visible' : 'hidden',\n utm: getUTMParameters(isFirstVisit, firstVisitUTM),\n \n // Add AI context\n aiContext: {\n isAIReferral: isAIReferral,\n aiPlatform: aiInfluenced ? aiData.platform : undefined,\n aiInfluenced: aiInfluenced,\n aiJourneyStage: isAIReferral ? 'entry' : \n (journey.userJourney.length === 0 ? 'exploration' :\n (currentUrl.includes('pricing') || currentUrl.includes('contact') ? 'decision' : 'consideration'))\n }\n };\n\n journey.userJourney.push(touchPoint);\n }\n\n // Recalculate AI journey analytics\n journey.aiJourneyAnalytics = calculateAIJourneyAnalytics(journey, journey.aiData);\n\n // Save updated journey to sessionStorage\n sessionStorage.setItem(STORAGE_KEY, JSON.stringify(journey));\n\n // Initialize form tracking\n initializeFormTracking();\n\n // Send AI tracking events to analytics platforms\n if (journey.aiData.platform !== 'none') {\n sendAITrackingEvents(journey, currentUrl);\n }\n\n resolve(journey);\n\n } catch (error: unknown) {\n console.error('Error tracking user journey:', error);\n resolve(null);\n }\n }, 200);\n });\n}\n\n// Send AI tracking events to analytics platforms\nfunction sendAITrackingEvents(journey: UserJourney, currentPage: string): void {\n const aiData = journey.aiData;\n const currentURL = new URL(window.location.href);\n \n const eventData = {\n ai_platform: aiData.platform,\n ai_type: aiData.type,\n ai_context: aiData.context,\n ai_confidence: aiData.confidence,\n detection_method: aiData.detectionMethod,\n landing_page: currentPage,\n page_category: getPageCategory(currentPage),\n \n // UTM data\n utm_source: currentURL.searchParams.get('utm_source') || '',\n utm_medium: currentURL.searchParams.get('utm_medium') || '',\n utm_campaign: currentURL.searchParams.get('utm_campaign') || '',\n utm_content: currentURL.searchParams.get('utm_content') || '',\n utm_term: currentURL.searchParams.get('utm_term') || '',\n \n // Journey data\n is_ai_user: journey.aiJourneyAnalytics.isAIUser,\n ai_touchpoints: journey.aiJourneyAnalytics.aiTouchPoints,\n session_start: aiData.detectedAt\n };\n \n // Event data is prepared but not sent to any external analytics platforms\n // This can be used for debugging or future analytics integration\n console.debug('AI tracking event data:', eventData);\n}\n\nfunction getPageCategory(pathname: string): string {\n if (pathname === '/') return 'Homepage';\n if (pathname.includes('/platform')) return 'Platform';\n if (pathname.includes('/solutions')) return 'Solutions';\n if (pathname.includes('/blog')) return 'Blog';\n if (pathname.includes('/developers') || pathname.includes('/api')) return 'Developer';\n if (pathname.includes('/contact') || pathname.includes('/demo')) return 'Contact';\n if (pathname.includes('/pricing')) return 'Pricing';\n if (pathname.includes('/about') || pathname.includes('/company')) return 'Company';\n return 'Other';\n}\n\n// Form tracking functionality (keeping original implementation)\nfunction initializeFormTracking(): void {\n const existingInputs = document.querySelectorAll('input[ph-form-field], textarea[ph-form-field], select[ph-form-field]');\n existingInputs.forEach(input => {\n input.removeEventListener('input', handleFormFieldChange);\n input.removeEventListener('change', handleFormFieldChange);\n });\n\n const formFields = document.querySelectorAll('input[ph-form-field], textarea[ph-form-field], select[ph-form-field]');\n formFields.forEach(field => {\n field.addEventListener('input', handleFormFieldChange);\n field.addEventListener('change', handleFormFieldChange);\n });\n\n initializeFormData();\n}\n\nfunction initializeFormData(): void {\n const journey = getUserJourney();\n if (!journey) return;\n\n const formContainer = document.querySelector('[ph-form-name]');\n if (!formContainer) return;\n\n const formName = formContainer.getAttribute('ph-form-name');\n const formId = formContainer.getAttribute('ph-form-id') || 'form-1';\n\n if (!formName) return;\n\n if (!journey.formDetails.formName) {\n journey.formDetails.formId = formId;\n journey.formDetails.formName = formName;\n }\n\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n}\n\nfunction handleFormFieldChange(event: Event): void {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n const fieldName = target.getAttribute('ph-form-field');\n\n if (!fieldName) return;\n\n const formContainer = target.closest('[ph-form-name]');\n if (!formContainer) return;\n\n const formName = formContainer.getAttribute('ph-form-name');\n const formId = formContainer.getAttribute('ph-form-id') || 'form-1';\n\n if (!formName) return;\n\n updateFormData(formName, formId, fieldName, target.value);\n}\n\nfunction updateFormData(formName: string, formId: string, fieldName: string, value: string): boolean {\n try {\n const journey = getUserJourney();\n if (!journey) return false;\n\n journey.formDetails.formId = formId;\n journey.formDetails.formName = formName;\n\n switch (fieldName) {\n case 'firstName':\n journey.formDetails.firstName = value;\n break;\n case 'lastName':\n journey.formDetails.lastName = value;\n break;\n case 'email':\n journey.formDetails.email = value;\n break;\n case 'phone':\n journey.formDetails.phone = value;\n break;\n default:\n console.warn(`Unknown field: ${fieldName}`);\n return false;\n }\n\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error) {\n console.error('Error updating form data:', error);\n return false;\n }\n}\n\n// Helper function to get current journey data\nfunction getUserJourney(): UserJourney | null {\n try {\n const storedData: string | null = sessionStorage.getItem('userJourney');\n return storedData ? JSON.parse(storedData) as UserJourney : null;\n } catch (error: unknown) {\n console.error('Error getting user journey:', error);\n return null;\n }\n}\n\n// Helper function to clear journey data\nfunction clearUserJourney(): void {\n sessionStorage.removeItem('userJourney');\n}\n\n// Helper function to update page categories manually\nfunction updatePageCategories(categories: string[]): boolean {\n try {\n const journey: UserJourney | null = getUserJourney();\n if (!journey || journey.userJourney.length === 0) return false;\n\n const lastVisit: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n lastVisit.category = categories.length > 0 ? categories : ['Not applicable'];\n\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error: unknown) {\n console.error('Error updating page categories:', error);\n return false;\n }\n}\n\nfunction updatePageType(type: string): boolean {\n try {\n const journey: UserJourney | null = getUserJourney();\n if (!journey || journey.userJourney.length === 0) return false;\n\n const lastVisit: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n lastVisit.type = type;\n\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error: unknown) {\n console.error('Error updating page type:', error);\n return false;\n }\n}\n\n// Enhanced journey statistics with AI metrics\nfunction getJourneyStats(): JourneyStats | null {\n const journey: UserJourney | null = getUserJourney();\n if (!journey || journey.userJourney.length === 0) return null;\n\n const firstVisit: TouchPoint = journey.userJourney[0];\n const lastVisit: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n\n const sessionDuration: number = new Date(lastVisit.time).getTime() - new Date(firstVisit.time).getTime();\n\n // Calculate AI-specific stats if this is an AI user\n let aiStats: JourneyStats['aiStats'];\n if (journey.aiJourneyAnalytics.isAIUser) {\n const aiEntryPoint = journey.userJourney.find(tp => tp.aiContext?.isAIReferral);\n const aiStartTime = aiEntryPoint ? new Date(aiEntryPoint.time) : new Date(firstVisit.time);\n const aiSessionDuration = new Date(lastVisit.time).getTime() - aiStartTime.getTime();\n \n const hasConversion = journey.userJourney.some(tp => \n tp.page.includes('contact') || tp.page.includes('demo') || tp.page.includes('pricing')\n );\n \n aiStats = {\n aiSessionDuration: Math.floor(aiSessionDuration / 1000),\n aiPages: journey.aiJourneyAnalytics.aiTouchPoints,\n aiConversionTime: hasConversion ? Math.floor(aiSessionDuration / 1000) : undefined,\n aiEngagementScore: calculateAIEngagementScore(journey),\n aiValueScore: calculateAIValueScore(journey)\n };\n }\n\n return {\n totalPages: journey.userJourney.length,\n sessionDuration: Math.floor(sessionDuration / 1000),\n firstPage: firstVisit.page,\n lastPage: lastVisit.page,\n aiStats: aiStats\n };\n}\n\n// Calculate AI engagement score based on behavior\nfunction calculateAIEngagementScore(journey: UserJourney): number {\n let score = 0;\n \n // Base score for being an AI user\n if (journey.aiJourneyAnalytics.isAIUser) score += 20;\n \n // Page depth scoring\n const pageCount = journey.userJourney.length;\n if (pageCount >= 5) score += 30;\n else if (pageCount >= 3) score += 20;\n else if (pageCount >= 2) score += 10;\n \n // Behavior pattern scoring\n const patterns = journey.aiJourneyAnalytics.behaviorPatterns;\n if (patterns.researchIntensive) score += 25;\n if (patterns.technicalFocus) score += 20;\n if (patterns.quickDecision) score += 15;\n \n // Page type engagement\n const hasHighValuePages = journey.userJourney.some(tp => \n tp.type.toLowerCase().includes('solution') || \n tp.type.toLowerCase().includes('pricing') ||\n tp.type.toLowerCase().includes('demo')\n );\n if (hasHighValuePages) score += 15;\n \n return Math.min(score, 100); // Cap at 100\n}\n\n// Calculate AI value score based on conversion indicators\nfunction calculateAIValueScore(journey: UserJourney): number {\n let score = 0;\n \n // High-confidence AI detection\n if (journey.aiData.confidence === 'high') score += 20;\n else if (journey.aiData.confidence === 'medium') score += 10;\n \n // Platform-specific scoring\n const highValuePlatforms = ['ChatGPT', 'Claude', 'Google_Gemini'];\n if (highValuePlatforms.includes(journey.aiData.platform)) score += 15;\n \n // Conversion indicators\n const pages = journey.userJourney.map(tp => tp.page.toLowerCase());\n if (pages.some(p => p.includes('pricing'))) score += 25;\n if (pages.some(p => p.includes('contact') || p.includes('demo'))) score += 30;\n if (pages.some(p => p.includes('api') || p.includes('developer'))) score += 20;\n \n // Form interaction\n const hasFormData = journey.formDetails.email || journey.formDetails.firstName;\n if (hasFormData) score += 20;\n \n return Math.min(score, 100); // Cap at 100\n}\n\n// Helper function to get form data\nfunction getFormData(): FormDetails | null {\n const journey = getUserJourney();\n return journey ? journey.formDetails : null;\n}\n\n// Helper function to get specific form field value\nfunction getFormFieldValue(fieldName: keyof FormDetails): string | null {\n const journey = getUserJourney();\n if (!journey) return null;\n return journey.formDetails[fieldName] || null;\n}\n\n// Helper function to manually update form data\nfunction setFormData(fieldName: keyof FormDetails, value: string): boolean {\n try {\n const journey = getUserJourney();\n if (!journey) return false;\n\n journey.formDetails[fieldName] = value;\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error) {\n console.error('Error setting form data:', error);\n return false;\n }\n}\n\n// Helper function to set form ID and name\nfunction setFormDetails(formId: string, formName: string): boolean {\n try {\n const journey = getUserJourney();\n if (!journey) return false;\n\n journey.formDetails.formId = formId;\n journey.formDetails.formName = formName;\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error) {\n console.error('Error setting form details:', error);\n return false;\n }\n}\n\n// Helper function to reinitialize form tracking\nfunction reinitializeFormTracking(): void {\n initializeFormTracking();\n}\n\n// New AI-specific helper functions\nfunction getAIData(): AIData | null {\n const journey = getUserJourney();\n return journey ? journey.aiData : null;\n}\n\nfunction getAIJourneyAnalytics(): UserJourney['aiJourneyAnalytics'] | null {\n const journey = getUserJourney();\n return journey ? journey.aiJourneyAnalytics : null;\n}\n\nfunction isAIUser(): boolean {\n const journey = getUserJourney();\n return journey ? journey.aiJourneyAnalytics.isAIUser : false;\n}\n\nfunction getAIPlatform(): string | null {\n const journey = getUserJourney();\n return journey && journey.aiData.platform !== 'none' ? journey.aiData.platform : null;\n}\n\nfunction forceAIDetection(): AIData {\n const aiData = detectAIPlatform();\n const journey = getUserJourney();\n \n if (journey) {\n journey.aiData = aiData;\n journey.aiJourneyAnalytics = calculateAIJourneyAnalytics(journey, aiData);\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n }\n \n return aiData;\n}\n\n// Auto-execute on page load\ndocument.addEventListener('DOMContentLoaded', (): void => {\n trackUserJourney();\n});\n\n// Also execute immediately if DOM is already loaded\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', (): void => {\n trackUserJourney();\n });\n} else {\n trackUserJourney();\n}\n\n// Make functions globally accessible\ndeclare global {\n interface Window {\n trackUserJourney: () => Promise<UserJourney | null>;\n getUserJourney: () => UserJourney | null;\n clearUserJourney: () => void;\n updatePageType: (type: string) => boolean;\n updatePageCategories: (categories: string[]) => boolean;\n getJourneyStats: () => JourneyStats | null;\n getFormData: () => FormDetails | null;\n getFormFieldValue: (fieldName: keyof FormDetails) => string | null;\n setFormData: (fieldName: keyof FormDetails, value: string) => boolean;\n setFormDetails: (formId: string, formName: string) => boolean;\n reinitializeFormTracking: () => void;\n \n // AI-specific functions\n getAIData: () => AIData | null;\n getAIJourneyAnalytics: () => UserJourney['aiJourneyAnalytics'] | null;\n isAIUser: () => boolean;\n getAIPlatform: () => string | null;\n forceAIDetection: () => AIData;\n detectAIPlatform: () => AIData;\n }\n}\n\n// Attach functions to window object for global access\nwindow.trackUserJourney = trackUserJourney;\nwindow.getUserJourney = getUserJourney;\nwindow.clearUserJourney = clearUserJourney;\nwindow.updatePageType = updatePageType;\nwindow.updatePageCategories = updatePageCategories;\nwindow.getJourneyStats = getJourneyStats;\nwindow.getFormData = getFormData;\nwindow.getFormFieldValue = getFormFieldValue;\nwindow.setFormData = setFormData;\nwindow.setFormDetails = setFormDetails;\nwindow.reinitializeFormTracking = reinitializeFormTracking;\n\n// AI-specific window functions\nwindow.getAIData = getAIData;\nwindow.getAIJourneyAnalytics = getAIJourneyAnalytics;\nwindow.isAIUser = isAIUser;\nwindow.getAIPlatform = getAIPlatform;\nwindow.forceAIDetection = forceAIDetection;\nwindow.detectAIPlatform = detectAIPlatform;\n\n// Export functions for module usage\nexport {\n trackUserJourney,\n getUserJourney,\n clearUserJourney,\n updatePageType,\n updatePageCategories,\n getJourneyStats,\n getFormData,\n getFormFieldValue,\n setFormData,\n setFormDetails,\n reinitializeFormTracking,\n \n // AI-specific exports\n getAIData,\n getAIJourneyAnalytics,\n isAIUser,\n getAIPlatform,\n forceAIDetection,\n detectAIPlatform\n};"],
|
|
5
|
-
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACSA,WAAS,iCAAiC,gBAAwB,WAA2B;AAEzF,QAAI,UAAU,aAAa,QAAQ;AAC/B,aAAO;AAAA,IACX;AAGA,WAAO;AAAA,EACX;AAGA,WAAS,mBAA2B;AAChC,UAAM,cAAc,SAAS;AAC7B,UAAM,WAAW,YAAY,YAAY;AACzC,UAAM,aAAa,IAAI,IAAI,OAAO,SAAS,IAAI;AAG/C,UAAM,YAAY,WAAW,aAAa,IAAI,YAAY,GAAG,YAAY,KAAK;AAC9E,UAAM,YAAY,WAAW,aAAa,IAAI,YAAY,GAAG,YAAY,KAAK;AAC9E,UAAM,cAAc,WAAW,aAAa,IAAI,cAAc,GAAG,YAAY,KAAK;AAClF,UAAM,aAAa,WAAW,aAAa,IAAI,aAAa,GAAG,YAAY,KAAK;AAGhF,UAAM,aAAa,GAAG,QAAQ,IAAI,SAAS,IAAI,SAAS,IAAI,WAAW,IAAI,UAAU;AAErF,QAAI,SAAiB;AAAA,MACjB,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,aAAY,oBAAI,KA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,CAAC;AAAA,IACjE;AAEA,WAAO;AAAA,EACX;AAGA,WAAS,iBAAiB,oBAAoB,MAAY;AACtD,qBAAiB;AAAA,EACrB,CAAC;AAGD,MAAI,SAAS,eAAe,WAAW;AACnC,aAAS,iBAAiB,oBAAoB,MAAY;AACtD,uBAAiB;AAAA,IACrB,CAAC;AAAA,EACL,OAAO;AACH,qBAAiB;AAAA,EACrB;AA4BA,SAAO,mBAAmB;AAC1B,SAAO,iBAAiB;AACxB,SAAO,mBAAmB;AAC1B,SAAO,iBAAiB;AACxB,SAAO,uBAAuB;AAC9B,SAAO,kBAAkB;AACzB,SAAO,cAAc;AACrB,SAAO,oBAAoB;AAC3B,SAAO,cAAc;AACrB,SAAO,iBAAiB;AACxB,SAAO,2BAA2B;AAGlC,SAAO,YAAY;AACnB,SAAO,wBAAwB;AAC/B,SAAO,WAAW;AAClB,SAAO,gBAAgB;AACvB,SAAO,mBAAmB;AAC1B,SAAO,mBAAmB;",
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// userJourney.ts - Enhanced with AI Detection\nimport {\n UTMParameters,\n TouchPoint,\n UserJourney,\n DeviceCategory,\n UTMVisibility,\n JourneyStats,\n FormDetails,\n AIData,\n AIPlatform,\n AIType,\n AIContext,\n AIDetectionMethod\n} from '../utils/types/user-journey';\n\nexport { };\n\n// Strategy 2: Use Latest Platform (Most recent AI influence)\nfunction handleAIDetection_LatestPlatform(existingAIData: AIData, newAIData: AIData): AIData {\n // Always use the most recent AI detection\n if (newAIData.platform !== 'none') {\n return newAIData;\n }\n\n // Keep existing if no new AI detected\n return existingAIData;\n}\n\n// AI Detection Functions\nfunction detectAIPlatform(): AIData {\n const referrerObj = document.referrer;\n const referrer = referrerObj.toLowerCase();\n const currentURL = new URL(window.location.href);\n\n // Extract UTM parameters\n const utmSource = currentURL.searchParams.get('utm_source')?.toLowerCase() || '';\n const utmMedium = currentURL.searchParams.get('utm_medium')?.toLowerCase() || '';\n const utmCampaign = currentURL.searchParams.get('utm_campaign')?.toLowerCase() || '';\n const utmContent = currentURL.searchParams.get('utm_content')?.toLowerCase() || '';\n\n // Combine all sources for detection\n const allSources = `${referrer} ${utmSource} ${utmMedium} ${utmCampaign} ${utmContent}`;\n\n let aiData: AIData = {\n platform: 'none',\n type: 'unknown',\n context: 'unknown',\n confidence: 'low',\n detectionMethod: 'none',\n detectedAt: new Date().toISOString()\n };\n\n // AI Platform Detection with keyword matching\n const aiPlatforms = [\n {\n keywords: ['chatgpt', 'openai', 'chat.openai'],\n platform: 'ChatGPT' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['perplexity'],\n platform: 'Perplexity' as AIPlatform,\n type: 'ai_search' as AIType,\n context: 'research_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['claude', 'anthropic'],\n platform: 'Claude' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['bing', 'copilot', 'microsoft-copilot'],\n platform: 'Bing_Copilot' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'medium' as const\n },\n {\n keywords: ['gemini', 'bard', 'google-ai'],\n platform: 'Google_Gemini' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['you.com', 'you-ai'],\n platform: 'You_AI' as AIPlatform,\n type: 'ai_search' as AIType,\n context: 'search_query' as AIContext,\n confidence: 'medium' as const\n },\n {\n keywords: ['character.ai', 'character'],\n platform: 'Character_AI' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'character_interaction' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['poe', 'quora-poe'],\n platform: 'Poe' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['huggingface', 'hf-chat'],\n platform: 'HuggingFace' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'technical_query' as AIContext,\n confidence: 'medium' as const\n },\n {\n keywords: ['replika'],\n platform: 'Replika' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'personal_assistant' as AIContext,\n confidence: 'high' as const\n }\n ];\n\n // Check for AI platform matches\n for (const platform of aiPlatforms) {\n const matchedKeyword = platform.keywords.find(keyword =>\n allSources.includes(keyword)\n );\n\n if (matchedKeyword) {\n aiData = {\n platform: platform.platform,\n type: platform.type,\n context: platform.context,\n confidence: platform.confidence,\n detectionMethod: getDetectionMethod(matchedKeyword, referrer, utmSource, utmMedium),\n detectedAt: new Date().toISOString()\n };\n break;\n }\n }\n\n // Enhanced detection for specific UTM patterns\n if (aiData.platform === 'none') {\n aiData = detectFromUTMPatterns(utmSource, utmMedium, utmCampaign, utmContent);\n }\n\n return aiData;\n}\n\n// Determine how the AI platform was detected\nfunction getDetectionMethod(matchedKeyword: string, referrer: string, utmSource: string, utmMedium: string): AIDetectionMethod {\n if (referrer.includes(matchedKeyword)) {\n return 'referrer';\n } else if (utmSource.includes(matchedKeyword)) {\n return 'utm_source';\n } else if (utmMedium.includes(matchedKeyword)) {\n return 'utm_medium';\n }\n return 'utm_other';\n}\n\n// Specific UTM pattern detection for AI platforms\nfunction detectFromUTMPatterns(utmSource: string, utmMedium: string, utmCampaign: string, utmContent: string): AIData {\n const aiUTMPatterns = [\n {\n condition: utmMedium.includes('ai') || utmMedium.includes('chat'),\n platform: 'AI_Generic' as AIPlatform,\n type: 'ai_unknown' as AIType,\n context: 'utm_tagged' as AIContext,\n confidence: 'medium' as const\n },\n {\n condition: utmCampaign.includes('ai-assistant') || utmCampaign.includes('chatbot'),\n platform: 'AI_Campaign' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'campaign_driven' as AIContext,\n confidence: 'medium' as const\n },\n {\n condition: utmContent.includes('ai-generated') || utmContent.includes('llm'),\n platform: 'AI_Content' as AIPlatform,\n type: 'ai_content' as AIType,\n context: 'content_discovery' as AIContext,\n confidence: 'medium' as const\n }\n ];\n\n for (const pattern of aiUTMPatterns) {\n if (pattern.condition) {\n return {\n platform: pattern.platform,\n type: pattern.type,\n context: pattern.context,\n confidence: pattern.confidence,\n detectionMethod: 'utm_pattern',\n detectedAt: new Date().toISOString()\n };\n }\n }\n\n return {\n platform: 'none',\n type: 'unknown',\n context: 'unknown',\n confidence: 'low',\n detectionMethod: 'none',\n detectedAt: new Date().toISOString()\n };\n}\n\n// AI Journey Analytics Functions\nfunction calculateAIJourneyAnalytics(journey: UserJourney, aiData: AIData): UserJourney['aiJourneyAnalytics'] {\n const isAIUser = aiData.platform !== 'none';\n\n if (!isAIUser) {\n return {\n isAIUser: false,\n aiTouchPoints: 0,\n aiEntryPage: null,\n behaviorPatterns: {\n skipsBranding: false,\n researchIntensive: false,\n quickDecision: false,\n technicalFocus: false\n },\n platformInsights: {\n expectedJourney: 'n/a',\n actualVsPredicted: 'matched',\n platformTypicalBehavior: 'n/a'\n }\n };\n }\n\n const aiEntryPage = journey.userJourney.find(tp => tp.aiContext?.isAIReferral)?.page || journey.userJourney[0]?.page || null;\n const aiTouchPoints = journey.userJourney.filter(tp => tp.aiContext?.aiInfluenced).length;\n\n // Analyze behavior patterns\n const pages = journey.userJourney.map(tp => tp.page.toLowerCase());\n const pageTypes = journey.userJourney.map(tp => tp.type.toLowerCase());\n\n const behaviorPatterns = {\n skipsBranding: !pages.some(p => p.includes('about') || p === '/') && pages.length > 1,\n researchIntensive: journey.userJourney.length > 5 || pageTypes.filter(t => t.includes('solution') || t.includes('blog')).length > 2,\n quickDecision: pages.some(p => p.includes('contact') || p.includes('demo') || p.includes('pricing')) && journey.userJourney.length <= 3,\n technicalFocus: pageTypes.some(t => t.toLowerCase().includes('api') || t.toLowerCase().includes('developer')) || pages.some(p => p.includes('api') || p.includes('developer'))\n };\n\n // Platform-specific insights\n const platformInsights = {\n expectedJourney: predictExpectedJourney(aiData.platform, aiEntryPage),\n actualVsPredicted: evaluateJourneyPerformance(journey, aiData.platform),\n platformTypicalBehavior: getPlatformTypicalBehavior(aiData.platform)\n };\n\n return {\n isAIUser,\n aiTouchPoints,\n aiEntryPage,\n aiConversionPath: pages,\n aiSessionDuration: calculateSessionDuration(journey),\n aiPageDepth: journey.userJourney.length,\n behaviorPatterns,\n platformInsights\n };\n}\n\nfunction predictExpectedJourney(platform: string, entryPage: string | null): string {\n const platformJourneys: Record<string, string> = {\n 'ChatGPT': 'solutions_exploration',\n 'Perplexity': 'research_deep_dive',\n 'Claude': 'technical_evaluation',\n 'Bing_Copilot': 'quick_overview',\n 'Google_Gemini': 'comparative_analysis'\n };\n\n return platformJourneys[platform] || 'general_exploration';\n}\n\nfunction evaluateJourneyPerformance(journey: UserJourney, platform: string): 'matched' | 'exceeded' | 'underperformed' {\n const pageCount = journey.userJourney.length;\n const hasConversion = journey.userJourney.some(tp =>\n tp.page.includes('contact') || tp.page.includes('demo') || tp.page.includes('pricing')\n );\n\n // Simple heuristic - can be made more sophisticated\n if (hasConversion && pageCount >= 3) return 'exceeded';\n if (pageCount >= 2) return 'matched';\n return 'underperformed';\n}\n\nfunction getPlatformTypicalBehavior(platform: string): string {\n const behaviors: Record<string, string> = {\n 'ChatGPT': 'Direct to solutions, conversion-focused',\n 'Perplexity': 'Research-heavy, multiple page views',\n 'Claude': 'Technical documentation focus',\n 'Bing_Copilot': 'Quick overview, efficiency-focused',\n 'Google_Gemini': 'Comparative analysis, thorough evaluation'\n };\n\n return behaviors[platform] || 'General exploration pattern';\n}\n\nfunction calculateSessionDuration(journey: UserJourney): number {\n if (journey.userJourney.length < 2) return 0;\n\n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n\n return Math.floor((lastVisit.getTime() - firstVisit.getTime()) / 1000);\n}\n\nasync function trackUserJourney(): Promise<UserJourney | null> {\n const STORAGE_KEY: string = 'userJourney';\n const SESSION_TIMEOUT: number = 30 * 60 * 1000; // 30 minutes\n\n // Helper function to get device category\n function getDeviceCategory(): DeviceCategory {\n const userAgent: string = navigator.userAgent;\n if (/tablet|ipad|playbook|silk/i.test(userAgent)) return 'Tablet';\n if (/mobile|iphone|ipod|android|blackberry|opera|mini|windows\\sce|palm|smartphone|iemobile/i.test(userAgent)) return 'Mobile';\n return 'Desktop';\n }\n\n // Helper function to get browser\n function getBrowser(): string {\n const userAgent: string = navigator.userAgent;\n if (userAgent.includes('Chrome') && !userAgent.includes('Edg')) return 'Chrome';\n if (userAgent.includes('Firefox')) return 'Firefox';\n if (userAgent.includes('Safari') && !userAgent.includes('Chrome')) return 'Safari';\n if (userAgent.includes('Edg')) return 'Edge';\n if (userAgent.includes('Opera')) return 'Opera';\n return 'Unknown';\n }\n\n // Helper function to get device name from user agent\n function getDeviceName(): string {\n const userAgent: string = navigator.userAgent;\n\n // Mobile devices\n if (/iPhone/.test(userAgent)) {\n const match = userAgent.match(/iPhone\\s*([^;]*)/);\n return match ? `iPhone ${match[1].trim()}` : 'iPhone';\n }\n\n if (/iPad/.test(userAgent)) {\n const match = userAgent.match(/iPad\\s*([^;]*)/);\n return match ? `iPad ${match[1].trim()}` : 'iPad';\n }\n\n if (/Android/.test(userAgent)) {\n const modelMatch = userAgent.match(/;\\s*([^)]*)\\s*\\)/);\n if (modelMatch) {\n const deviceInfo = modelMatch[1].trim();\n const cleanDevice = deviceInfo\n .replace(/wv/g, '')\n .replace(/Build\\/.*$/g, '')\n .replace(/\\s+/g, ' ')\n .trim();\n return cleanDevice || 'Android Device';\n }\n return 'Android Device';\n }\n\n // Desktop/Laptop detection\n if (/Windows/.test(userAgent)) {\n if (/Windows NT 10/.test(userAgent)) return 'Windows 10/11 PC';\n if (/Windows NT 6\\.3/.test(userAgent)) return 'Windows 8.1 PC';\n if (/Windows NT 6\\.2/.test(userAgent)) return 'Windows 8 PC';\n if (/Windows NT 6\\.1/.test(userAgent)) return 'Windows 7 PC';\n return 'Windows PC';\n }\n\n if (/Macintosh/.test(userAgent)) {\n if (/Intel/.test(userAgent)) return 'Mac (Intel)';\n if (/Apple Silicon|ARM64/.test(userAgent)) return 'Mac (Apple Silicon)';\n return 'Mac';\n }\n\n if (/Linux/.test(userAgent)) {\n return 'Linux PC';\n }\n\n if (/BlackBerry/.test(userAgent)) return 'BlackBerry';\n if (/Windows Phone/.test(userAgent)) return 'Windows Phone';\n\n const deviceCategory = getDeviceCategory();\n return deviceCategory.charAt(0).toUpperCase();\n }\n\n // Helper function to extract domain from referrer\n function extractDomainFromReferrer(referrer: string): string {\n if (!referrer) return 'Unknown';\n\n try {\n const url = new URL(referrer);\n const hostname = url.hostname;\n const domain = hostname.replace(/^www\\./, '');\n const domainParts = domain.split('.');\n if (domainParts.length >= 2) {\n return domainParts[0];\n }\n return domain || 'Unknown';\n } catch (error) {\n return 'Unknown';\n }\n }\n\n // Enhanced UTM parameters with AI detection context\n function getUTMParameters(isFirstVisit: boolean, firstVisitUTM?: UTMParameters): UTMParameters {\n const urlParams: URLSearchParams = new URLSearchParams(window.location.search);\n const hasCurrentUTM: boolean = urlParams.has('utm_source') || urlParams.has('utm_medium') || urlParams.has('utm_campaign');\n\n if (isFirstVisit || hasCurrentUTM) {\n if (hasCurrentUTM) {\n return {\n source: urlParams.get('utm_source') || '',\n medium: urlParams.get('utm_medium') || '',\n campaign: urlParams.get('utm_campaign') || '',\n content: urlParams.get('utm_content') || '',\n term: urlParams.get('utm_term') || ''\n };\n } else {\n const referrerDomain = extractDomainFromReferrer(document.referrer);\n return {\n source: referrerDomain,\n medium: 'organic',\n campaign: 'unknown'\n };\n }\n } else {\n return firstVisitUTM || {\n source: 'Unknown',\n medium: 'organic',\n campaign: 'unknown'\n };\n }\n }\n\n // Helper function to get page categories from global variable\n function getPageCategories(): string[] {\n try {\n if (typeof (window as any).pageCategories !== 'undefined' &&\n Array.isArray((window as any).pageCategories) &&\n (window as any).pageCategories.length > 0) {\n return (window as any).pageCategories;\n }\n return ['Not applicable'];\n } catch (error) {\n console.warn('Error accessing pageCategories:', error);\n return ['Not applicable'];\n }\n }\n\n function hasVisibleUTM(): boolean {\n const urlParams: URLSearchParams = new URLSearchParams(window.location.search);\n return urlParams.has('utm_source') || urlParams.has('utm_medium') || urlParams.has('utm_campaign');\n }\n\n // Helper function to get page type (same as original)\n function getPageType(url: string): string {\n const path: string = url.split('?')[0].toLowerCase();\n\n const typeConfig = {\n exactMatches: {\n '/': 'Home',\n '/home': 'Home',\n '/blog': 'Blog listing',\n '/about-us': 'About us',\n '/contact-us': 'Contact',\n '/privacy-policy': 'Privacy policy',\n '/terms-of-service': 'Terms of service',\n '/careers': 'Careers',\n '/customer-stories': 'Customer stories listing',\n '/events': 'Events listing',\n '/infographics': 'Infographics listing',\n '/newsroom': 'Newsroom',\n '/releases': 'Releases listing',\n } as Record<string, string>,\n\n pathStartsWith: [\n { pattern: '/blog/', type: 'Blog' },\n { pattern: '/customer-stories/', type: 'Customer story' },\n { pattern: '/case-studies/', type: 'Case study' },\n { pattern: '/solutions/', type: 'Solution' },\n { pattern: '/events/', type: 'Event' },\n { pattern: '/news/', type: 'News' },\n { pattern: '/press-releases/', type: 'Press release' },\n { pattern: '/releases/', type: 'Release' },\n ]\n };\n\n if (typeConfig.exactMatches[path]) {\n return typeConfig.exactMatches[path];\n }\n\n for (const item of typeConfig.pathStartsWith) {\n if (path.startsWith(item.pattern)) {\n return item.type;\n }\n }\n\n return 'Other';\n }\n\n // Check if session is still valid\n function isValidSession(journey: UserJourney): boolean {\n if (!journey.userJourney || journey.userJourney.length === 0) return false;\n const lastVisit: Date = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n const now: Date = new Date();\n return (now.getTime() - lastVisit.getTime()) < SESSION_TIMEOUT;\n }\n\n // Add 200ms delay before executing the main logic\n return new Promise((resolve) => {\n setTimeout(() => {\n try {\n // Detect AI platform first\n const aiData = detectAIPlatform();\n\n // Get existing journey from localStorage\n let journey: UserJourney | null = null;\n const storedData: string | null = localStorage.getItem(STORAGE_KEY);\n\n if (storedData) {\n const parsedData: UserJourney = JSON.parse(storedData);\n if (isValidSession(parsedData)) {\n journey = parsedData;\n }\n }\n\n // Initialize new journey if none exists or session expired\n if (!journey) {\n journey = {\n userJourney: [],\n origin: window.location.hostname,\n deviceCategory: getDeviceCategory(),\n browser: getBrowser(),\n device: getDeviceName(),\n formDetails: {\n formId: '',\n formName: '',\n firstName: '',\n lastName: '',\n email: '',\n phone: ''\n },\n // Initialize AI data\n aiData: aiData,\n aiJourneyAnalytics: {\n isAIUser: false,\n aiTouchPoints: 0,\n aiEntryPage: null,\n behaviorPatterns: {\n skipsBranding: false,\n researchIntensive: false,\n quickDecision: false,\n technicalFocus: false\n },\n platformInsights: {\n expectedJourney: 'n/a',\n actualVsPredicted: 'matched',\n platformTypicalBehavior: 'n/a'\n }\n }\n };\n } else {\n // Update existing journey with AI data using latest platform strategy\n const updatedAIData = handleAIDetection_LatestPlatform(journey.aiData || {\n platform: 'none',\n type: 'unknown',\n context: 'unknown',\n confidence: 'low',\n detectionMethod: 'none',\n detectedAt: new Date().toISOString()\n }, aiData);\n\n journey.aiData = updatedAIData;\n journey.aiJourneyAnalytics = calculateAIJourneyAnalytics(journey, updatedAIData);\n }\n\n // Ensure backward compatibility\n if (!journey.formDetails) {\n journey.formDetails = {\n formId: '',\n formName: '',\n firstName: '',\n lastName: '',\n email: '',\n phone: ''\n };\n }\n\n if (!journey.device) {\n journey.device = getDeviceName();\n }\n\n if (!journey) {\n console.error('Journey initialization failed');\n resolve(null);\n return;\n }\n\n // Get current page info\n const currentUrl: string = window.location.pathname;\n const currentTime: string = new Date().toISOString();\n\n // Check if this is the same page as the last visit\n const lastVisit: TouchPoint | undefined = journey.userJourney[journey.userJourney.length - 1];\n if (lastVisit && lastVisit.page === currentUrl) {\n lastVisit.time = currentTime;\n } else {\n // New page visit\n const isFirstVisit: boolean = journey.userJourney.length === 0;\n const firstVisitUTM: UTMParameters | undefined = isFirstVisit ? undefined : journey.userJourney[0].utm;\n\n // Determine AI context for this touchpoint\n const isAIReferral = isFirstVisit && aiData.platform !== 'none';\n const aiInfluenced = journey.aiData.platform !== 'none';\n\n const touchPoint: TouchPoint = {\n touchPoint: journey.userJourney.length + 1,\n page: currentUrl,\n title: document.title || 'Untitled',\n type: getPageType(currentUrl),\n category: getPageCategories(),\n time: currentTime,\n utmVisibility: hasVisibleUTM() ? 'visible' : 'hidden',\n utm: getUTMParameters(isFirstVisit, firstVisitUTM),\n\n // Add AI context\n aiContext: {\n isAIReferral: isAIReferral,\n aiPlatform: aiInfluenced ? aiData.platform : undefined,\n aiInfluenced: aiInfluenced,\n aiJourneyStage: isAIReferral ? 'entry' :\n (journey.userJourney.length === 0 ? 'exploration' :\n (currentUrl.includes('pricing') || currentUrl.includes('contact') ? 'decision' : 'consideration'))\n }\n };\n\n journey.userJourney.push(touchPoint);\n }\n\n // Recalculate AI journey analytics\n journey.aiJourneyAnalytics = calculateAIJourneyAnalytics(journey, journey.aiData);\n\n // Save updated journey to localStorage\n localStorage.setItem(STORAGE_KEY, JSON.stringify(journey));\n\n // Initialize form tracking\n initializeFormTracking();\n\n // Send AI tracking events to analytics platforms\n if (journey.aiData.platform !== 'none') {\n sendAITrackingEvents(journey, currentUrl);\n }\n\n resolve(journey);\n\n } catch (error: unknown) {\n console.error('Error tracking user journey:', error);\n resolve(null);\n }\n }, 200);\n });\n}\n\n// Send AI tracking events to analytics platforms\nfunction sendAITrackingEvents(journey: UserJourney, currentPage: string): void {\n const aiData = journey.aiData;\n const currentURL = new URL(window.location.href);\n\n const eventData = {\n ai_platform: aiData.platform,\n ai_type: aiData.type,\n ai_context: aiData.context,\n ai_confidence: aiData.confidence,\n detection_method: aiData.detectionMethod,\n landing_page: currentPage,\n page_category: getPageCategory(currentPage),\n\n // UTM data\n utm_source: currentURL.searchParams.get('utm_source') || '',\n utm_medium: currentURL.searchParams.get('utm_medium') || '',\n utm_campaign: currentURL.searchParams.get('utm_campaign') || '',\n utm_content: currentURL.searchParams.get('utm_content') || '',\n utm_term: currentURL.searchParams.get('utm_term') || '',\n\n // Journey data\n is_ai_user: journey.aiJourneyAnalytics.isAIUser,\n ai_touchpoints: journey.aiJourneyAnalytics.aiTouchPoints,\n session_start: aiData.detectedAt\n };\n\n // Event data is prepared but not sent to any external analytics platforms\n // This can be used for debugging or future analytics integration\n console.debug('AI tracking event data:', eventData);\n}\n\nfunction getPageCategory(pathname: string): string {\n if (pathname === '/') return 'Homepage';\n if (pathname.includes('/platform')) return 'Platform';\n if (pathname.includes('/solutions')) return 'Solutions';\n if (pathname.includes('/blog')) return 'Blog';\n if (pathname.includes('/developers') || pathname.includes('/api')) return 'Developer';\n if (pathname.includes('/contact') || pathname.includes('/demo')) return 'Contact';\n if (pathname.includes('/pricing')) return 'Pricing';\n if (pathname.includes('/about') || pathname.includes('/company')) return 'Company';\n return 'Other';\n}\n\n// Form tracking functionality (keeping original implementation)\nfunction initializeFormTracking(): void {\n const existingInputs = document.querySelectorAll('input[ph-form-field], textarea[ph-form-field], select[ph-form-field]');\n existingInputs.forEach(input => {\n input.removeEventListener('input', handleFormFieldChange);\n input.removeEventListener('change', handleFormFieldChange);\n });\n\n const formFields = document.querySelectorAll('input[ph-form-field], textarea[ph-form-field], select[ph-form-field]');\n formFields.forEach(field => {\n field.addEventListener('input', handleFormFieldChange);\n field.addEventListener('change', handleFormFieldChange);\n });\n\n initializeFormData();\n}\n\nfunction initializeFormData(): void {\n const journey = getUserJourney();\n if (!journey) return;\n\n const formContainer = document.querySelector('[ph-form-name]');\n if (!formContainer) return;\n\n const formName = formContainer.getAttribute('ph-form-name');\n const formId = formContainer.getAttribute('ph-form-id') || 'form-1';\n\n if (!formName) return;\n\n if (!journey.formDetails.formName) {\n journey.formDetails.formId = formId;\n journey.formDetails.formName = formName;\n }\n\n localStorage.setItem('userJourney', JSON.stringify(journey));\n}\n\nfunction handleFormFieldChange(event: Event): void {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n const fieldName = target.getAttribute('ph-form-field');\n\n if (!fieldName) return;\n\n const formContainer = target.closest('[ph-form-name]');\n if (!formContainer) return;\n\n const formName = formContainer.getAttribute('ph-form-name');\n const formId = formContainer.getAttribute('ph-form-id') || 'form-1';\n\n if (!formName) return;\n\n updateFormData(formName, formId, fieldName, target.value);\n}\n\nfunction updateFormData(formName: string, formId: string, fieldName: string, value: string): boolean {\n try {\n const journey = getUserJourney();\n if (!journey) return false;\n\n journey.formDetails.formId = formId;\n journey.formDetails.formName = formName;\n\n switch (fieldName) {\n case 'firstName':\n journey.formDetails.firstName = value;\n break;\n case 'lastName':\n journey.formDetails.lastName = value;\n break;\n case 'email':\n journey.formDetails.email = value;\n break;\n case 'phone':\n journey.formDetails.phone = value;\n break;\n default:\n console.warn(`Unknown field: ${fieldName}`);\n return false;\n }\n\n localStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error) {\n console.error('Error updating form data:', error);\n return false;\n }\n}\n\n// Helper function to get current journey data\nfunction getUserJourney(): UserJourney | null {\n try {\n const storedData: string | null = localStorage.getItem('userJourney');\n return storedData ? JSON.parse(storedData) as UserJourney : null;\n } catch (error: unknown) {\n console.error('Error getting user journey:', error);\n return null;\n }\n}\n\n// Helper function to clear journey data\nfunction clearUserJourney(): void {\n localStorage.removeItem('userJourney');\n}\n\n// Helper function to update page categories manually\nfunction updatePageCategories(categories: string[]): boolean {\n try {\n const journey: UserJourney | null = getUserJourney();\n if (!journey || journey.userJourney.length === 0) return false;\n\n const lastVisit: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n lastVisit.category = categories.length > 0 ? categories : ['Not applicable'];\n\n localStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error: unknown) {\n console.error('Error updating page categories:', error);\n return false;\n }\n}\n\nfunction updatePageType(type: string): boolean {\n try {\n const journey: UserJourney | null = getUserJourney();\n if (!journey || journey.userJourney.length === 0) return false;\n\n const lastVisit: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n lastVisit.type = type;\n\n localStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error: unknown) {\n console.error('Error updating page type:', error);\n return false;\n }\n}\n\n// Enhanced journey statistics with AI metrics\nfunction getJourneyStats(): JourneyStats | null {\n const journey: UserJourney | null = getUserJourney();\n if (!journey || journey.userJourney.length === 0) return null;\n\n const firstVisit: TouchPoint = journey.userJourney[0];\n const lastVisit: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n\n const sessionDuration: number = new Date(lastVisit.time).getTime() - new Date(firstVisit.time).getTime();\n\n // Calculate AI-specific stats if this is an AI user\n let aiStats: JourneyStats['aiStats'];\n if (journey.aiJourneyAnalytics.isAIUser) {\n const aiEntryPoint = journey.userJourney.find(tp => tp.aiContext?.isAIReferral);\n const aiStartTime = aiEntryPoint ? new Date(aiEntryPoint.time) : new Date(firstVisit.time);\n const aiSessionDuration = new Date(lastVisit.time).getTime() - aiStartTime.getTime();\n\n const hasConversion = journey.userJourney.some(tp =>\n tp.page.includes('contact') || tp.page.includes('demo') || tp.page.includes('pricing')\n );\n\n aiStats = {\n aiSessionDuration: Math.floor(aiSessionDuration / 1000),\n aiPages: journey.aiJourneyAnalytics.aiTouchPoints,\n aiConversionTime: hasConversion ? Math.floor(aiSessionDuration / 1000) : undefined,\n aiEngagementScore: calculateAIEngagementScore(journey),\n aiValueScore: calculateAIValueScore(journey)\n };\n }\n\n return {\n totalPages: journey.userJourney.length,\n sessionDuration: Math.floor(sessionDuration / 1000),\n firstPage: firstVisit.page,\n lastPage: lastVisit.page,\n aiStats: aiStats\n };\n}\n\n// Calculate AI engagement score based on behavior\nfunction calculateAIEngagementScore(journey: UserJourney): number {\n let score = 0;\n\n // Base score for being an AI user\n if (journey.aiJourneyAnalytics.isAIUser) score += 20;\n\n // Page depth scoring\n const pageCount = journey.userJourney.length;\n if (pageCount >= 5) score += 30;\n else if (pageCount >= 3) score += 20;\n else if (pageCount >= 2) score += 10;\n\n // Behavior pattern scoring\n const patterns = journey.aiJourneyAnalytics.behaviorPatterns;\n if (patterns.researchIntensive) score += 25;\n if (patterns.technicalFocus) score += 20;\n if (patterns.quickDecision) score += 15;\n\n // Page type engagement\n const hasHighValuePages = journey.userJourney.some(tp =>\n tp.type.toLowerCase().includes('solution') ||\n tp.type.toLowerCase().includes('pricing') ||\n tp.type.toLowerCase().includes('demo')\n );\n if (hasHighValuePages) score += 15;\n\n return Math.min(score, 100); // Cap at 100\n}\n\n// Calculate AI value score based on conversion indicators\nfunction calculateAIValueScore(journey: UserJourney): number {\n let score = 0;\n\n // High-confidence AI detection\n if (journey.aiData.confidence === 'high') score += 20;\n else if (journey.aiData.confidence === 'medium') score += 10;\n\n // Platform-specific scoring\n const highValuePlatforms = ['ChatGPT', 'Claude', 'Google_Gemini'];\n if (highValuePlatforms.includes(journey.aiData.platform)) score += 15;\n\n // Conversion indicators\n const pages = journey.userJourney.map(tp => tp.page.toLowerCase());\n if (pages.some(p => p.includes('pricing'))) score += 25;\n if (pages.some(p => p.includes('contact') || p.includes('demo'))) score += 30;\n if (pages.some(p => p.includes('api') || p.includes('developer'))) score += 20;\n\n // Form interaction\n const hasFormData = journey.formDetails.email || journey.formDetails.firstName;\n if (hasFormData) score += 20;\n\n return Math.min(score, 100); // Cap at 100\n}\n\n// Helper function to get form data\nfunction getFormData(): FormDetails | null {\n const journey = getUserJourney();\n return journey ? journey.formDetails : null;\n}\n\n// Helper function to get specific form field value\nfunction getFormFieldValue(fieldName: keyof FormDetails): string | null {\n const journey = getUserJourney();\n if (!journey) return null;\n return journey.formDetails[fieldName] || null;\n}\n\n// Helper function to manually update form data\nfunction setFormData(fieldName: keyof FormDetails, value: string): boolean {\n try {\n const journey = getUserJourney();\n if (!journey) return false;\n\n journey.formDetails[fieldName] = value;\n localStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error) {\n console.error('Error setting form data:', error);\n return false;\n }\n}\n\n// Helper function to set form ID and name\nfunction setFormDetails(formId: string, formName: string): boolean {\n try {\n const journey = getUserJourney();\n if (!journey) return false;\n\n journey.formDetails.formId = formId;\n journey.formDetails.formName = formName;\n localStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error) {\n console.error('Error setting form details:', error);\n return false;\n }\n}\n\n// Helper function to reinitialize form tracking\nfunction reinitializeFormTracking(): void {\n initializeFormTracking();\n}\n\n// New AI-specific helper functions\nfunction getAIData(): AIData | null {\n const journey = getUserJourney();\n return journey ? journey.aiData : null;\n}\n\nfunction getAIJourneyAnalytics(): UserJourney['aiJourneyAnalytics'] | null {\n const journey = getUserJourney();\n return journey ? journey.aiJourneyAnalytics : null;\n}\n\nfunction isAIUser(): boolean {\n const journey = getUserJourney();\n return journey ? journey.aiJourneyAnalytics.isAIUser : false;\n}\n\nfunction getAIPlatform(): string | null {\n const journey = getUserJourney();\n return journey && journey.aiData.platform !== 'none' ? journey.aiData.platform : null;\n}\n\nfunction forceAIDetection(): AIData {\n const aiData = detectAIPlatform();\n const journey = getUserJourney();\n\n if (journey) {\n journey.aiData = aiData;\n journey.aiJourneyAnalytics = calculateAIJourneyAnalytics(journey, aiData);\n localStorage.setItem('userJourney', JSON.stringify(journey));\n }\n\n return aiData;\n}\n\n// Auto-execute on page load\ndocument.addEventListener('DOMContentLoaded', (): void => {\n trackUserJourney();\n});\n\n// Also execute immediately if DOM is already loaded\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', (): void => {\n trackUserJourney();\n });\n} else {\n trackUserJourney();\n}\n\n// Make functions globally accessible\ndeclare global {\n interface Window {\n trackUserJourney: () => Promise<UserJourney | null>;\n getUserJourney: () => UserJourney | null;\n clearUserJourney: () => void;\n updatePageType: (type: string) => boolean;\n updatePageCategories: (categories: string[]) => boolean;\n getJourneyStats: () => JourneyStats | null;\n getFormData: () => FormDetails | null;\n getFormFieldValue: (fieldName: keyof FormDetails) => string | null;\n setFormData: (fieldName: keyof FormDetails, value: string) => boolean;\n setFormDetails: (formId: string, formName: string) => boolean;\n reinitializeFormTracking: () => void;\n\n // AI-specific functions\n getAIData: () => AIData | null;\n getAIJourneyAnalytics: () => UserJourney['aiJourneyAnalytics'] | null;\n isAIUser: () => boolean;\n getAIPlatform: () => string | null;\n forceAIDetection: () => AIData;\n detectAIPlatform: () => AIData;\n }\n}\n\n// Attach functions to window object for global access\nwindow.trackUserJourney = trackUserJourney;\nwindow.getUserJourney = getUserJourney;\nwindow.clearUserJourney = clearUserJourney;\nwindow.updatePageType = updatePageType;\nwindow.updatePageCategories = updatePageCategories;\nwindow.getJourneyStats = getJourneyStats;\nwindow.getFormData = getFormData;\nwindow.getFormFieldValue = getFormFieldValue;\nwindow.setFormData = setFormData;\nwindow.setFormDetails = setFormDetails;\nwindow.reinitializeFormTracking = reinitializeFormTracking;\n\n// AI-specific window functions\nwindow.getAIData = getAIData;\nwindow.getAIJourneyAnalytics = getAIJourneyAnalytics;\nwindow.isAIUser = isAIUser;\nwindow.getAIPlatform = getAIPlatform;\nwindow.forceAIDetection = forceAIDetection;\nwindow.detectAIPlatform = detectAIPlatform;\n\n// Export functions for module usage\nexport {\n trackUserJourney,\n getUserJourney,\n clearUserJourney,\n updatePageType,\n updatePageCategories,\n getJourneyStats,\n getFormData,\n getFormFieldValue,\n setFormData,\n setFormDetails,\n reinitializeFormTracking,\n\n // AI-specific exports\n getAIData,\n getAIJourneyAnalytics,\n isAIUser,\n getAIPlatform,\n forceAIDetection,\n detectAIPlatform\n};"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;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