* HKILD Section Engagement Tracking for Wix * * Tracks: * - Time spent in each section (using Intersection Observer) * - Button clicks in each section * * Sends data to Wix Collection: hkild_section_engagement * * Installation: * 1. Add this code to Wix Custom Code element * 2. Place on PD mobile page */ (function() { 'use strict'; // Configuration const config = { collectionId: 'section_engagement', sections: [ { id: 'hero', name: 'Hero + Stats', selector: '.hero, [class*="hero"]' }, { id: 'honest-check', name: '報讀前問自己', selector: '[class*="honest"]' }, { id: 'four-advantages', name: '四大核心優勢', selector: '[class*="advantage"]' }, { id: 'course-content', name: '理論實戰並重', selector: '[class*="course"], [class*="content"]' }, { id: 'live-practice', name: '實戰練習', selector: '[class*="practice"], [class*="live"]' }, { id: 'graduation', name: '畢業成果', selector: '[class*="graduate"], [class*="graduation"]' }, { id: 'outcomes', name: '課程成果', selector: '[class*="outcome"]' }, { id: 'testimonials', name: '學員真實分享', selector: '[class*="testimonial"]' }, { id: 'schedule', name: '開班時間', selector: '[class*="schedule"], [class*="time"]' }, { id: 'faq', name: '常見問題', selector: '[class*="faq"], [class*="question"]' } ], flushInterval: 30000 // Send data every 30 seconds }; // Track state const state = { sections: {}, pendingData: [], flushTimer: null }; // Initialize section tracking state config.sections.forEach(section => { state.sections[section.id] = { name: section.name, timeSpent: 0, entered: 0, left: 0, lastEntered: null, isCurrentlyIn: false }; }); /** * Format date as YYYY-MM-DD */ function getDateString() { const now = new Date(); return now.toISOString().split('T')[0]; } /** * Get ISO timestamp */ function getTimestamp() { return new Date().toISOString(); } /** * Send data to Wix Collection */ async function sendDataToWix(data) { try { // Use Wix Data API to insert item const response = await fetch(`https://www.wixapis.com/v1/contacts/me`, { method: 'GET', headers: { 'Authorization': wixLocation.authorization } }); if (response.ok) { // If we can authenticate, send data const insertResponse = await fetch( `https://www.wixapis.com/wix-data/v2/items/${config.collectionId}`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': wixLocation.authorization }, body: JSON.stringify({ dataItem: { data: { section_id: data.sectionId, page_url: window.location.href, time_spent: data.timeSpent, button_clicks: data.buttonClicks || 0, last_updated: new Date().toISOString().split('T')[0], visitor_id: data.visitorId || 'anonymous' } } }) } ); if (insertResponse.ok) { console.log('✅ Tracking data sent to Wix:', data); } else { console.warn('⚠️ Failed to send tracking data to Wix:', insertResponse.status); } } } catch (error) { console.warn('⚠️ Could not send to Wix API:', error.message); // Fallback: store in localStorage as backup saveToLocalStorage(data); } } /** * Fallback: save to localStorage */ function saveToLocalStorage(data) { try { const key = 'hkild_user_behavior'; const existing = JSON.parse(localStorage.getItem(key) || '{}'); const today = getDateString(); if (!existing[today]) { existing[today] = { sections: {}, buttonClicks: [] }; } // Update section data existing[today].sections[data.sectionId] = { timeSpent: data.timeSpent, entered: data.entered, left: data.left }; localStorage.setItem(key, JSON.stringify(existing)); } catch (e) { console.warn('localStorage not available:', e); } } /** * Flush pending data to Wix */ async function flushData() { if (state.pendingData.length === 0) return; const dataToSend = [...state.pendingData]; state.pendingData = []; for (const data of dataToSend) { await sendDataToWix(data); // Small delay between requests await new Promise(resolve => setTimeout(resolve, 100)); } } /** * Record section entry */ function recordSectionEntry(sectionId) { if (!state.sections[sectionId]) return; const section = state.sections[sectionId]; section.entered++; section.lastEntered = Date.now(); section.isCurrentlyIn = true; console.log(`📍 Entered: ${section.name}`); } /** * Record section exit */ function recordSectionExit(sectionId) { if (!state.sections[sectionId]) return; const section = state.sections[sectionId]; if (section.lastEntered) { const elapsed = Math.round((Date.now() - section.lastEntered) / 1000); section.timeSpent += elapsed; section.left++; console.log(`📍 Exited: ${section.name} (${elapsed}s)`); } section.isCurrentlyIn = false; // Queue data to send const dataToSend = { date: getDateString(), sectionId: sectionId, sectionName: section.name, timeSpent: section.timeSpent, entered: section.entered, left: section.left, timestamp: getTimestamp() }; state.pendingData.push(dataToSend); } /** * Record button click in section */ function recordButtonClick(sectionId, buttonText) { const dataToSend = { date: getDateString(), sectionId: sectionId, sectionName: state.sections[sectionId]?.name || 'Unknown', buttonText: buttonText, timestamp: getTimestamp() }; state.pendingData.push(dataToSend); console.log(`🔘 Button clicked in ${sectionId}: ${buttonText}`); } /** * Setup Intersection Observer for section tracking */ function setupIntersectionObserver() { const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { recordSectionEntry(entry.target.dataset.sectionId); } else { recordSectionExit(entry.target.dataset.sectionId); } }); }, { threshold: 0.1 // Trigger when 10% of section is visible }); // Observe all sections config.sections.forEach(section => { const elements = document.querySelectorAll(section.selector); elements.forEach(el => { el.dataset.sectionId = section.id; observer.observe(el); }); }); console.log('✅ Intersection Observer initialized'); } /** * Setup button click tracking */ function setupButtonTracking() { document.addEventListener('click', (event) => { const button = event.target.closest('button, a[role="button"]'); if (!button) return; // Find which section this button is in let section = button.closest('[data-section-id]'); if (section) { const sectionId = section.dataset.sectionId; const buttonText = button.textContent.trim().substring(0, 50); recordButtonClick(sectionId, buttonText); } }, true); console.log('✅ Button tracking initialized'); } /** * Initialize everything */ function initialize() { console.log('🚀 HKILD Tracking Initialized'); // Setup observers setupIntersectionObserver(); setupButtonTracking(); // Auto-flush data periodically state.flushTimer = setInterval(flushData, config.flushInterval); // Flush on page unload window.addEventListener('beforeunload', flushData); // Expose for debugging window.hkildTracking = { getState: () => state, flushData: flushData, recordButtonClick: recordButtonClick, recordSectionEntry: recordSectionEntry, recordSectionExit: recordSectionExit }; } // Start when DOM is ready if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initialize); } else { initialize(); } })();
top of page

抽血流程的奧秘

  • 作家相片: Tin Chau Lee
    Tin Chau Lee
  • 2024年5月26日
  • 讀畢需時 2 分鐘


抽血的流程到底是怎樣?抽血員的職責到底是什麼?除了抽血外,抽血員的職責還有心電圖檢查和收集樣本。他們需要純熟的技術外,和有能力照顧抽血者的情緒,所以抽血員並不是簡單的工作,抽血的過程也比想像中複雜,本篇文章會討論抽血流程的奧秘。


抽血過程


抽血員在抽血的時候,首先要觸摸抽血者的皮膚,找到血管位置,但要避開筋腱和動脈,再綁上止血帶令血管膨脹,然後再對準血管位置打上抽血針抽血。


不同抽血者的程序


不同的抽血者的身體狀況並不一樣,抽血員要因應不同人的情況去處理,否則有可能會傷害到抽血者的血管和皮膚。當中長者和肥胖人士更是要小心處理的對象。


長者


長者是抽血員要小心應付的對象,他們的皮膚較薄而且血管很脆弱。因此抽血員的手法要比較輕柔。而且冬季時,長者的血管可能會收縮,讓抽血員難以找到血管,這時候用暖包敷着長者的傷口一段時間,等血管膨脹後才能更容易地找到血管,實在沒有辦法的話,可能要用幼針針管來進行抽血。


肥胖人士


為肥胖人士抽血也是比較困難的,肥胖人士的皮下脂肪比較多,血管都藏得比較深,可能要用到長的針頭,和比較有經驗的抽血員去處理,以避免抽血者受到不必要的傷害。


照顧抽血者的情緒


抽血者在抽血的過程中也要照顧到抽血者的情緒,如果抽血者的情緒太緊張有可能會影響到抽血的進行,尤其是為兒童抽血。兒童比較不能控制自己的情緒。這時抽血員便要想辦法安撫好抽血者的情緒,例如放音樂及進行輕鬆的對話等。盡量讓抽血者放鬆下以更好地進行抽血。


抽血者要注意什麼?


不止是抽血員在抽血過程中扮演重要的角色,抽血者也有要注意的地方。


  1. 抽血者要告知不適及過敏歷史


抽血者在抽血前應該主動告知抽血員任何不適感及過敏歷史,包括對某些藥物、膠帶或消毒劑的過敏反應。這些信息有助於抽血員做出適當的安排,確保病人的安全。例如,對於膠帶過敏的病人,抽血員可以選擇使用無過敏性的替代品。


  1. 避免進行劇烈運動


抽血者在抽血後,應避免在24小時入做劇烈運動,因為這樣可能會導致抽血的部位再次出血或令瘀青的範圍擴大。而且抽血後應有適當的休息,避免暈眩或更嚴重的情況出現。



結論


抽血是一個看似簡單但實際上非常重要的醫療程序,抽血員在這個過程中承擔了多重責任,不僅要熟練掌握技術,還要細心照顧病人的情緒和特殊需求。了解抽血過程、不同抽血者的注意事項以及抽血後的護理建議,對於保障病人的安全和舒適至關重要。通過專業的操作和細心的服務,抽血員能夠有效地完成他們的職責,並為醫療診斷提供可靠的數據支持。




 
 
 

留言


香港生命開展學會 Hong Kong institute of Life Development

E-mail: info@hkild.com  

Tel: 852- 6906 3436

Address: Unit C 13/F Nathan Tower, 518-520 Nathan Road, Kowloon

九龍油麻地彌敦道518-520號 (彌敦行) 13 樓 C 室

Stationary photo

©2013 by HKILD.  All Rights Reserved.

bottom of page