* 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

消毒藥水疑受細菌污染

  • 作家相片: Admin
    Admin
  • 2019年9月19日
  • 讀畢需時 3 分鐘




內容轉自明報
內容轉自明報

【明報專訊】一款常用作洗傷口、於社區藥房及公院店舖售賣的粉紅色消毒藥水疑受細菌污染。瑪麗醫院追查過去兩年53名腹膜透析病人曾感染洋葱伯克氏菌,當中5人出現入侵性感染,包括細菌入血,事件觸發其他公院追查,揭發連同其他公院有逾100名洗腎病人曾感染該菌。而瑪麗醫院抽取約50個Pro-Medi Prosept消毒藥水樣本化驗,約八成驗出該菌。有專家稱該菌入血可致敗血症致命。據悉追查發現有數人離世,但無證據顯示與感染該菌有直接關係。衛生署呼籲巿民停用該款消毒藥水,而供應商回收有關產品。

數人離世 稱沒證據與染菌有關

瑪麗醫院9月6日從4名腹膜透析病人的導管口採集的臨牀樣本中,驗出洋葱伯克氏菌。瑪麗醫院遂回顧過去兩年腹膜透析病人的化驗樣本,發現53名病人曾感染洋葱伯克氏菌,涉24男29女,介乎24至90歲,當中5人出現入侵性感染。據悉,病人出現腹膜炎及細菌入血個案。消息指出,有數人離世,惟沒證據顯示有病人因感染該細菌而離世。

公院品牌未驗出 社區樣本八成中招

醫管局表示,根據環境監測結果,公立醫院及診所使用的兩種品牌氯己定消毒劑均沒驗出洋葱伯克氏菌,但從社區藥房及部分醫院內的醫療用品店收集的預先包裝氯己定消毒劑樣本則驗出帶有洋葱伯克氏菌。據了解,瑪麗醫院在醫院店舖及社區藥房等抽了約50個Pro-Medi Prosept消毒藥水樣本作化驗,其中約40個驗出洋葱伯克氏菌;而其他公立醫院檢視腹膜透析病人情况,發現最少50人曾感染洋葱伯克氏菌,但未知感染源頭,需繼續調查。消息指出,事件疑涉洗腎病人按醫院指示在社區自行購買消毒藥水清洗造口有關。Pro-Medi Prosept消毒藥水含有0.05%氯己定,不列作藥劑製品,一般腹膜透析病人會在家中使用該產品消毒皮膚和導管出口位置。醫管局發言人表示,已通知醫院內醫療用品店有關事件及需停售該消毒劑,醫管局腎科中央委員會已通報各腎科部門提醒病人需按指引於家中進行導管口護理,局方將重新檢視公立醫院腎科病人感染洋葱伯克氏菌的化驗結果,提醒病人若懷疑傷口感染,應向醫護人員查詢。衛生署呼籲市民切勿使用Pro-Medi Prosept消毒藥水作傷口護理,署方昨到產品供應商寶源(美國)藥業有限公司巡查及檢取樣本化驗,寶源從市面回收有關產品。衛生署方已聯絡本地私家醫院及註冊洗腎中心了解,聯絡受感染病人跟進調查,另向醫生發信提醒停用有問題產品。

何栢良:健康者影響微 洗傷口或入血

香港大學感染及傳染病中心總監何栢良解釋,洋葱伯克氏菌是於環境內常見細菌,對很多抗生素及稀釋消毒劑有一定抗藥性,若製藥過程處理不當,消毒劑有可能受污染。他稱市民用受感染消毒劑清洗傷口,傷口或會發炎,但洋葱伯克氏菌入侵性較低,攻擊力低,對健康者影響微。但何栢良說,做腹膜透析病人有導管在腹膜經皮膚到體外,導管與皮膚間有傷口,病人用到受感染的消毒劑清洗,則易受感染,而患有腎衰竭等身體抵疫力較差的病人,細菌或從導管走入腹膜,引致腹膜炎,若在放入靜脈導管用了受感染消毒劑,或造成細菌入血,有可能因感染敗血症而死。

留言


香港生命開展學會 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