Pass ConceptualHQ visitor ID and CTA placement to Calendly - #6825
Conversation
mihaibudiu
left a comment
There was a problem hiding this comment.
I didn't look carefully at the tests
mythical-fred
left a comment
There was a problem hiding this comment.
Small, well-scoped web-console change. The ConceptualHQ visitor ID and CTA placement now flow through Calendly via utm_content + prefixed utm_term, and the plumbing is clean: a module-level $state in useConceptualHq.svelte.ts seeded from window.ca?.getDeviceId?.() with a localStorage fallback and an SSR guard, refreshed on the loader's onload, plus a small pure bookADemoUrl() in calendly.ts behind decent unit tests. Callers are consistently migrated from triggerLocation to placement. Not a blocker in any way.
A few points worth confirming before merge; none block:
-
Analytics event shape change is silent.
useTryPipelinenow emitsdemo_openedwithplacementin place oftrigger_location, andBookADemo.svelterenames thecalendly_openedproperty the same way. If PostHog dashboards or ConceptualHQ funnels key offtrigger_location, they'll go blind after this ships. Either coordinate with whoever owns those dashboards, or send both keys for one release cycle and droptrigger_locationafter. Cheap either way. -
Calendly URL is quietly different. Old:
https://calendly.com/d/cqnj-p63-mbq/feldera-demo. New (DEMO_URLincalendly.ts):https://calendly.com/d/cxz2-37b-qqd/feldera-demo-30min. That's a distinct event — different slug, different name. The PR body only says "augment the link"; it doesn't mention swapping the event. Please call it out in the description (and confirm the new event is the one sales wants bookings to land on). -
DemoTile.sveltestill calls its own proptriggerLocationand forwards it intotryPipeline(demo, triggerLocation). Given every other component moved toplacement, this is a small consistency wart — worth renaming for grep-ability. Not urgent. -
utm_contentcollision comment. The doc comment says "If the original link ever includesutm_content— carryvisitorIdinsalesforce_uuid." That's a future-you note, not an enforcement — fine, but if the link ever does start carryingutm_contentupstream, the current code will silently clobber it. Consider aconsole.warnwhenurl.searchParams.has(VISITOR_ID_PARAM)before setting, so the migration doesn't happen invisibly. -
Loader race.
refreshConceptualHqDeviceIdfires onscript.onload, but ConceptualHQ'sgetDeviceId()is only guaranteed once their loader has processed itsqqueue. In practice it's synchronous inside the loader, soonloadis fine — just worth a code comment because it looks race-prone at first read.
Approve on the current tip (cec2115d); please address 1 and 2 in the PR body/coordination before merging so the analytics side isn't surprised.
Will address 3-5, they're worth doing. |
…dly to help track user journey in the public sandbox Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
cd421fd to
46b8f1d
Compare
mythical-fred
left a comment
There was a problem hiding this comment.
Thanks for the fast turnaround. The three code-level nits from my last pass all landed:
DemoTile.svelte(+ its spec) now usesplacement, matching every other component.setTrackingParamemits aconsole.warnwhen the demo link ever ships withutm_content/utm_termof its own, so the salesforce_uuid migration won't happen invisibly. New spec assertion for the no-collision case locks it in.- Comment on
script.onload = refreshConceptualHqDeviceIdinconceptualHq.tsexplains why the loader hook is not a race: the queue drain andgetDeviceIdinstall are synchronous inside the vendor script, soonloadsees a fully-installedca. Flags the deferred-work regression path for future readers.
Points 1 (silent trigger_location → placement analytics rename) and 2 (Calendly slug swap cqnj-p63-mbq/feldera-demo → cxz2-37b-qqd/feldera-demo-30min) are the two I flagged as coordination-not-code — as long as the PostHog/HubSpot side is aware before this ships, we're good.
Re-approving on 46b8f1df.
… to help track user journey in the public sandbox
There already was code that asynchronously loaded ConceptualHQ script that provides
getDeviceId()throughwindow.ca- a generated identifier that helps track the user on their journey through the public website and the sandbox;This PR uses it to augment the link to Calendly to forward this device ID and the CTA placement (the location of the button in web-console which user clicked to book a demo) through Calendly