Hướng dẫn từng bước để bật conversion tracking cho touchpoints và tích hợp Li2 Analytics SDK vào website hoặc ứng dụng của bạn.
Hướng Dẫn Cài Đặt Conversion Tracking
Trong hướng dẫn này: Bạn sẽ học cách bật conversion tracking cho touchpoints, cài đặt Li2 Analytics SDK, và chuẩn bị hệ thống để track lead và sale events.
Yêu Cầu Trước Khi Bắt Đầu
Yêu cầu gói dịch vụ: Conversion tracking chỉ khả dụng cho:
Premium Plan trở lên
Premium Trial (để dùng thử)
Nếu bạn đang dùng gói Free hoặc Basic, vui lòng nâng cấp để sử dụng tính năng này.
Trước khi bắt đầu, hãy đảm bảo bạn có:
Quyền Truy Cập
Owner hoặc Manager role trong organization
Touchpoint Đã Tạo
Ít nhất một touchpoint để track conversions
Website/App
Khả năng thêm JavaScript code vào trang web của bạn
Gói Premium+
Premium plan hoặc cao hơn
Tổng Quan Quy Trình Cài Đặt
Quá trình cài đặt conversion tracking gồm 4 bước chính:
1
Bật Conversion Tracking cho Touchpoint
Kích hoạt tracking trong touchpoint settings
2
Cài Đặt Li2 Analytics SDK
Thêm tracking code vào website/app của bạn
3
Cấu Hình Bảo Mật
Thiết lập allowed hostnames để bảo vệ dữ liệu
4
Xác Minh Cài Đặt
Test và confirm tracking hoạt động đúng
Bước 1: Bật Conversion Tracking cho Touchpoint
1.1 Truy Cập Touchpoint Settings
1
Mở Touchpoint Details
Trong dashboard, navigate đến Touch-Points và chọn touchpoint bạn muốn track conversions.
2
Vào Phần Settings
Click tab Settings (biểu tượng ⚙️) trong touchpoint details page.
3
Tìm Conversion Tracking Section
Scroll xuống phần Advanced Settings → tìm Conversion Tracking.
1.2 Kích Hoạt Conversion Tracking
Trong phần Conversion Tracking:
Toggle switch sang ON (màu xanh)
Click Save Changes để lưu
Best Practice: Chỉ bật conversion tracking cho touchpoints thực sự cần đo lường ROI (ví dụ: campaign chính, landing pages quan trọng). Điều này giúp giữ dữ liệu sạch và dễ phân tích.
Bật conversion tracking không ảnh hưởng đến hoạt động hiện tại của touchpoint. Link ngắn, QR code, và NFC vẫn hoạt động bình thường. Tracking chỉ bắt đầu khi bạn tích hợp SDK (Bước 2).
Bước 2: Cài Đặt Li2 Analytics SDK
Li2 Analytics SDK là thư viện JavaScript giúp track conversions tự động.
HTML / JavaScript
WordPress
Cài Đặt cho Website HTML Thông Thường
Thêm script này vào <head> hoặc trước </body> của tất cả các pages cần track:
Thay li2_pk_xxxxxxxx bằng publishable key thực của bạn từ Settings → Analytics
Vị trí đặt script:
Trong <head>: Load sớm, đảm bảo tracking luôn hoạt động
Trước </body>: Không block page render, nhưng có thể miss early events
Khuyến nghị: Đặt trong <head> với defer attribute (đã có sẵn trong script) để balance giữa performance và tracking accuracy.
Cài Đặt cho WordPress
Plugin Đang Phát Triển: Chúng tôi đang phát triển Li2 Analytics plugin cho WordPress để cài đặt dễ dàng hơn. Hiện tại, vui lòng sử dụng phương pháp thêm script thủ công bên dưới.
Cách 1: Sử dụng Plugin “Insert Headers and Footers”
Cài đặt plugin Insert Headers and Footers
Vào Settings → Insert Headers and Footers
Paste script tracking code (từ tab HTML/JavaScript) vào Scripts in Header
Chú ý: Nếu update theme, bạn sẽ mất code tracking. Khuyến nghị dùng plugin hoặc child theme để tránh vấn đề này.
Bước 3: Cấu Hình Bảo Mật
3.1 Thiết Lập Allowed Hostnames
Allowed Hostnames là danh sách domains được phép gửi tracking requests. Đây là lớp bảo mật quan trọng để chặn abuse.
1
Mở Analytics Settings
Navigate đến Settings → Analytics trong organization settings.
2
Thêm Allowed Hostnames
Trong phần Security, tìm Allowed Hostnames và add domains của bạn:Ví dụ:
example.com - Chỉ cho phép domain chính xác
*.example.com - Cho phép tất cả subdomains (www, app, blog, etc.)
localhost - Cho phép local development (khuyến nghị trong dev)
3
Save Changes
Click Save để áp dụng whitelist.
Quan trọng: Nếu không add allowed hostnames, tracking requests sẽ BỊ CHẶN. Đảm bảo add đủ tất cả domains và subdomains bạn sử dụng.
Wildcard Support:
Pattern
Cho phép
example.com
Chỉ example.com
www.example.com
Chỉ www.example.com
*.example.com
app.example.com, blog.example.com, etc.
*
Tất cả domains (KHÔNG khuyến nghị cho production)
Development Setup: Khi develop local, add localhost hoặc 127.0.0.1 vào allowed hostnames. Remove khi deploy production.
3.2 Xem Lại Publishable Key
Publishable key được tự động tạo khi bạn enable Analytics. Để xem:
Vào Settings → Analytics
Copy Publishable Key (dạng li2_pk_...)
Paste vào SDK configuration (đã làm ở Bước 2)
Publishable vs Secret Key:
Publishable key (li2_pk_...): An toàn để expose phía client, dùng cho SDK
Secret key (li2_sk_...): Chỉ dùng server-side, KHÔNG expose ra client
Conversion tracking SDK chỉ cần publishable key.
Bước 4: Xác Minh Cài Đặt
4.1 Test Click ID Capture
Sau khi cài đặt SDK, test xem click ID có được capture đúng không:
1
Tạo Test Link
Từ touchpoint đã enable conversion tracking, copy short link (VD: li2.link/test-campaign)
2
Click Link Trong Incognito Mode
Mở trình duyệt ở chế độ ẩn danh (Incognito) và click vào short link
3
Kiểm Tra Cookie
Mở Developer Tools (F12) → Application → CookiesTìm cookie tên li_cid với value dạng: cm3w...✅ Thành công nếu cookie tồn tại❌ Thất bại nếu không có cookie → Check lại SDK installation
4
Verify Trong Console
Trong Console tab, nhập:
li2Analytics
Nếu SDK load đúng, bạn sẽ thấy object với functions: trackLead, trackSale
Không thấy li_cid cookie?
Nguyên nhân phổ biến:
SDK chưa load: Check Network tab, tìm request đến unpkg.com/@li2/analytics
Publishable key sai: Verify key trong script khớp với key trong Settings
Click link không có uid parameter: Li2 tự động add parameter ?uid=... - nếu không có, touchpoint setting có thể chưa đúng
Third-party cookies bị block: Một số browser block third-party cookies - li_cid là first-party nên không bị ảnh hưởng, nhưng check setting browser
Cách fix: Re-install SDK, verify publishable key, test lại với browser khác
li2Analytics undefined trong console?
Nguyên nhân:
Script chưa load xong: Đợi page load hoàn toàn rồi thử lại
CDN blocked: Check Network tab xem request đến unpkg.com có bị block không
Ad blocker: Tắt ad blocker và test lại
Cách fix: Check script tag trong HTML source, verify CDN accessible, disable ad blockers
Tracking requests bị CORS error?
Nguyên nhân:
Domain hiện tại không có trong Allowed Hostnames
Cách fix:
Vào Settings → Analytics → Allowed Hostnames
Add domain hiện tại (VD: example.com)
Save và test lại
CORS error message thường rất rõ ràng: Request origin 'https://example.com' is not included in the allowed hostnames. Copy exact domain và add vào allowed list.
4.2 Test End-to-End Flow (Optional)
Để test toàn bộ flow từ click → lead tracking:
// Mở Console sau khi click vào touchpoint linkli2Analytics.trackLead({ eventName: "Test Lead", customerExternalId: "test-user-123", customerEmail: "[email protected]", customerName: "Test User"});
Check Network tab - nên thấy POST request đến API endpoint với status 200 OK.
Lưu ý: Test lead này sẽ được ghi nhận thật trong database. Hiện tại Li2 chưa hỗ trợ delete conversion events qua UI. Khuyến nghị:
Sử dụng eventName: "Test ..." để dễ phân biệt với real data
Hoặc test trên development/staging environment trước khi deploy production
Hoàn Tất! 🎉
Bạn đã cài đặt xong conversion tracking! Các bước tiếp theo:
Track Lead Events
Học cách track khi khách hàng sign up hoặc thể hiện quan tâm
Track Sale Events
Học cách track revenue khi khách hàng mua hàng
GTM Integration
Cài đặt conversion tracking qua Google Tag Manager
Advanced Setup
Cấu hình conversion goals và custom events
Track từ app iOS?
Li2 Swift SDK: API conversion tự gắn về deep-link match (trackAttributedSale, identify)
Troubleshooting
Conversion tracking toggle bị disabled (xám)?
Nguyên nhân: Organization chưa có Premium plan.Cách fix:
Vào Settings → Billing
Upgrade lên Premium hoặc cao hơn
Hoặc start Premium Trial để test
SDK load chậm, ảnh hưởng page speed?
Giải pháp:
SDK đã được optimize với defer loading - không block page render
CDN global distribution đảm bảo latency thấp
Minified bundle size < 10KB
Nếu vẫn lo ngại: Load SDK async sau khi page interactive:
Tracking conversion từ mobile app (iOS / Android)?
Trang này nói về Li2 Analytics SDK (web/JavaScript) — không chạy trong app native.
App iOS có deep link: dùng Li2 Swift SDK (0.2.0+). Nó có API conversion định kiểu riêng (trackDirectLead / trackAttributedLead / trackAttributedSale / identify) tự gắn về deep-link match qua Li2.lastClickId — không cần truyền click ID thủ công. Xem Đo lường chuyển đổi trong Tích Hợp App.
Android / nền tảng khác, hoặc khi không có deep link: dùng server-side tracking với secret key (li2_sk_...) và truyền clickId thủ công. Xem Events Tracking - Server-side.
Làm sao biết touchpoint nào đã enable conversion tracking?
Trong Touch-Points list, tìm icon 📊 bên cạnh touchpoint name. Icon này chỉ xuất hiện khi conversion tracking đã được enabled.Hoặc filter touchpoints với Advanced Filters → Conversion Tracking = Enabled.
Best Practices
1. Enable tracking có chọn lọc: Chỉ enable cho touchpoints quan trọng để data sạch và dễ analyze.2. Test trong development: Luôn add localhost vào allowed hostnames khi develop, remove khi deploy production.3. Monitor setup: Check Analytics dashboard thường xuyên trong tuần đầu sau setup để catch issues sớm.4. Document your setup: Ghi lại publishable key, allowed hostnames ở đâu để team khác có thể maintain.5. Secure your keys: Publishable key an toàn cho client, nhưng KHÔNG commit secret keys vào Git.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Li2.ai Documentation","colors":{"primary":"#7C3AED","light":"#A855F7","dark":"#5B21B6"},"logo":{"light":"https://mintcdn.com/ftc/3ap442ix0jtT2vEo/shared/logos/light.png?fit=max\u0026auto=format\u0026n=3ap442ix0jtT2vEo\u0026q=85\u0026s=43c97af8b1705fa2ed279991dd0c65dc","dark":"https://mintcdn.com/ftc/3ap442ix0jtT2vEo/shared/logos/dark.png?fit=max\u0026auto=format\u0026n=3ap442ix0jtT2vEo\u0026q=85\u0026s=96a7c6d8384dcca88ca858dc5690556b"},"favicon":"https://mintcdn.com/ftc/8XnS9rNoHzBv-302/favicon.svg?fit=max\u0026auto=format\u0026n=8XnS9rNoHzBv-302\u0026q=85\u0026s=5837a710d4f5bf2fd4e35b98e46de8a3","navbar":{"links":[{"href":"mailto:[email protected]","label":"Support"}],"primary":{"type":"button","label":"Open Dashboard","href":"https://app.li2.ai"}},"footer":{"socials":{"website":"https://li2.ai"}},"search":{"prompt":"Search Li2.ai documentation..."},"interaction":{"drilldown":true},"styling":{"latex":true},"navigation":{"languages":[{"language":"vi","default":true,"href":"vi/guide"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"ftc","hasAudioNarration":false,"actualSubdomain":"ftc","customDomains":["docs.li2.ai"],"gitSource":{"type":"github","owner":"qquik","repo":"li2-docs","deployBranch":"main-v1","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae92b8cab814ccd6585abb4:success","clientVersion":"0.0.4344","searchFilterCounts":[{"language":"vi","tag":"Trung tâm hỗ trợ","count":37},{"language":"vi","tag":"Tài liệu cho Developers","count":16},{"language":"vi","tag":"Bắt Đầu","count":7},{"language":"vi","tag":"Phân Tích \u0026 Báo Cáo","count":7},{"language":"vi","tag":"Deep Link (Liên kết sâu)","count":6},{"language":"vi","tag":"Team \u0026 Tổ Chức","count":6},{"language":"vi","tag":"Đo Lường Chuyển Đổi","count":5},{"language":"vi","tag":"Tùy Chỉnh Link \u0026 QR","count":5},{"language":"vi","tag":"Deep Links (Mở App)","count":4},{"language":"vi","tag":"Tổ Chức \u0026 Chiến Dịch","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"vi/conversion-tracking/setup","slug":"/vi/conversion-tracking/setup","pageMetadata":{"title":"Hướng Dẫn Cài Đặt Conversion Tracking","description":"Hướng dẫn từng bước để bật conversion tracking cho touchpoints và tích hợp Li2 Analytics SDK vào website hoặc ứng dụng của bạn.","sidebarTitle":"Cài Đặt","icon":"screwdriver-wrench","href":"/vi/conversion-tracking/setup"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Hướng dẫn từng bước để bật conversion tracking cho touchpoints và tích hợp Li2 Analytics SDK vào website hoặc ứng dụng của bạn.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,AccordionGroup,Card,CardGroup,CodeBlock,Heading,Info,Note,Step,Steps,Tab,Table,Tabs,Tip,Warning}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!AccordionGroup)_missingMdxReference(`AccordionGroup`,true);if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`hướng-dẫn-cài-đặt-conversion-tracking`,children:`Hướng Dẫn Cài Đặt Conversion Tracking`}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Trong hướng dẫn này`}),`: Bạn sẽ học cách bật conversion tracking cho touchpoints, cài đặt Li2 Analytics SDK, và chuẩn bị hệ thống để track lead và sale events.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`yêu-cầu-trước-khi-bắt-đầu`,children:`Yêu Cầu Trước Khi Bắt Đầu`}),`\n`,_jsxs(Warning,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Yêu cầu gói dịch vụ`}),`: Conversion tracking chỉ khả dụng cho:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Premium Plan`}),` trở lên`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Premium Trial`}),` (để dùng thử)`]}),`\n`]}),_jsx(_components.p,{children:`Nếu bạn đang dùng gói Free hoặc Basic, vui lòng nâng cấp để sử dụng tính năng này.`})]}),`\n`,_jsx(_components.p,{children:`Trước khi bắt đầu, hãy đảm bảo bạn có:`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Quyền Truy Cập`,icon:`user-shield`,children:_jsx(_components.p,{children:`Owner hoặc Manager role trong organization`})}),_jsx(Card,{title:`Touchpoint Đã Tạo`,icon:`diamond`,children:_jsx(_components.p,{children:`Ít nhất một touchpoint để track conversions`})}),_jsx(Card,{title:`Website/App`,icon:`code`,children:_jsx(_components.p,{children:`Khả năng thêm JavaScript code vào trang web của bạn`})}),_jsx(Card,{title:`Gói Premium+`,icon:`crown`,children:_jsx(_components.p,{children:`Premium plan hoặc cao hơn`})})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`tổng-quan-quy-trình-cài-đặt`,children:`Tổng Quan Quy Trình Cài Đặt`}),`\n`,_jsx(_components.p,{children:`Quá trình cài đặt conversion tracking gồm 4 bước chính:`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Bật Conversion Tracking cho Touchpoint`,children:_jsx(_components.p,{children:`Kích hoạt tracking trong touchpoint settings`})}),_jsx(Step,{title:`Cài Đặt Li2 Analytics SDK`,children:_jsx(_components.p,{children:`Thêm tracking code vào website/app của bạn`})}),_jsx(Step,{title:`Cấu Hình Bảo Mật`,children:_jsx(_components.p,{children:`Thiết lập allowed hostnames để bảo vệ dữ liệu`})}),_jsx(Step,{title:`Xác Minh Cài Đặt`,children:_jsx(_components.p,{children:`Test và confirm tracking hoạt động đúng`})})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`bước-1-bật-conversion-tracking-cho-touchpoint`,children:`Bước 1: Bật Conversion Tracking cho Touchpoint`}),`\n`,_jsx(Heading,{level:`3`,id:`1-1-truy-cập-touchpoint-settings`,children:`1.1 Truy Cập Touchpoint Settings`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Mở Touchpoint Details`,children:_jsxs(_components.p,{children:[`Trong dashboard, navigate đến `,_jsx(_components.strong,{children:`Touch-Points`}),` và chọn touchpoint bạn muốn track conversions.`]})}),_jsx(Step,{title:`Vào Phần Settings`,children:_jsxs(_components.p,{children:[`Click tab `,_jsx(_components.strong,{children:`Settings`}),` (biểu tượng ⚙️) trong touchpoint details page.`]})}),_jsx(Step,{title:`Tìm Conversion Tracking Section`,children:_jsxs(_components.p,{children:[`Scroll xuống phần `,_jsx(_components.strong,{children:`Advanced Settings`}),` → tìm `,_jsx(_components.strong,{children:`Conversion Tracking`}),`.`]})})]}),`\n`,_jsx(Heading,{level:`3`,id:`1-2-kích-hoạt-conversion-tracking`,children:`1.2 Kích Hoạt Conversion Tracking`}),`\n`,_jsx(_components.p,{children:`Trong phần Conversion Tracking:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Toggle switch`}),` sang ON (màu xanh)`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Save Changes`}),` để lưu`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Best Practice`}),`: Chỉ bật conversion tracking cho touchpoints thực sự cần đo lường ROI (ví dụ: campaign chính, landing pages quan trọng). Điều này giúp giữ dữ liệu sạch và dễ phân tích.`]})}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Bật conversion tracking không ảnh hưởng đến hoạt động hiện tại của touchpoint. Link ngắn, QR code, và NFC vẫn hoạt động bình thường. Tracking chỉ bắt đầu khi bạn tích hợp SDK (Bước 2).`})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`bước-2-cài-đặt-li2-analytics-sdk`,children:`Bước 2: Cài Đặt Li2 Analytics SDK`}),`\n`,_jsx(_components.p,{children:`Li2 Analytics SDK là thư viện JavaScript giúp track conversions tự động.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`HTML / JavaScript`,icon:`code`,id:`html-%2F-javascript`,\"data-child-heading-ids\":`[\"c%C3%A0i-%C4%91%E1%BA%B7t-cho-website-html-th%C3%B4ng-th%C6%B0%E1%BB%9Dng\"]`,children:[_jsx(Heading,{level:`3`,id:`cài-đặt-cho-website-html-thông-thường`,children:`Cài Đặt cho Website HTML Thông Thường`}),_jsxs(_components.p,{children:[`Thêm script này vào `,_jsx(_components.code,{children:`\u003chead>`}),` hoặc trước `,_jsx(_components.code,{children:`\u003c/body>`}),` của tất cả các pages cần track:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`script`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`||`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`q`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`q`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` []).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`push`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`arguments`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"trackLead\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"trackSale\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forEach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`t`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`t`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`a`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`n`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`](`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`t`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`a`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` s`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` document`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createElement`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"script\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` s`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`defer`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` s`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`src`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://unpkg.com/@li2/analytics/dist/index.global.js\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` s`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`setAttribute`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"data-publishable-key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"li2_pk_xxxxxxxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` document`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`head`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`appendChild`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`s`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"li2Analytics\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`script`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`]})})}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Thay thế publishableKey:`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Tìm dòng: `,_jsx(_components.code,{children:`s.setAttribute(\"data-publishable-key\", \"li2_pk_xxxxxxxx\");`})]}),`\n`,_jsxs(_components.li,{children:[`Thay `,_jsx(_components.code,{children:`li2_pk_xxxxxxxx`}),` bằng publishable key thực của bạn từ Settings → Analytics`]}),`\n`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Vị trí đặt script:`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Trong `,_jsx(_components.code,{children:`\u003chead>`})]}),`: Load sớm, đảm bảo tracking luôn hoạt động`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Trước `,_jsx(_components.code,{children:`\u003c/body>`})]}),`: Không block page render, nhưng có thể miss early events`]}),`\n`]}),_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Khuyến nghị`}),`: Đặt trong `,_jsx(_components.code,{children:`\u003chead>`}),` với `,_jsx(_components.code,{children:`defer`}),` attribute (đã có sẵn trong script) để balance giữa performance và tracking accuracy.`]})})]}),_jsxs(Tab,{title:`WordPress`,icon:`wordpress`,id:`wordpress`,\"data-child-heading-ids\":`[\"c%C3%A0i-%C4%91%E1%BA%B7t-cho-wordpress\"]`,children:[_jsx(Heading,{level:`3`,id:`cài-đặt-cho-wordpress`,children:`Cài Đặt cho WordPress`}),_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Plugin Đang Phát Triển`}),`: Chúng tôi đang phát triển Li2 Analytics plugin cho WordPress để cài đặt dễ dàng hơn. Hiện tại, vui lòng sử dụng phương pháp thêm script thủ công bên dưới.`]})}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Cách 1: Sử dụng Plugin “Insert Headers and Footers”`})}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Cài đặt plugin `,_jsx(_components.strong,{children:`Insert Headers and Footers`})]}),`\n`,_jsxs(_components.li,{children:[`Vào `,_jsx(_components.strong,{children:`Settings → Insert Headers and Footers`})]}),`\n`,_jsxs(_components.li,{children:[`Paste script tracking code (từ tab HTML/JavaScript) vào `,_jsx(_components.strong,{children:`Scripts in Header`})]}),`\n`,_jsx(_components.li,{children:`Save changes`}),`\n`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Cách 2: Thêm Trực Tiếp vào Theme`})}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Vào `,_jsx(_components.strong,{children:`Appearance → Theme File Editor`})]}),`\n`,_jsxs(_components.li,{children:[`Mở file `,_jsx(_components.code,{children:`header.php`})]}),`\n`,_jsxs(_components.li,{children:[`Paste script tracking code (từ tab HTML/JavaScript) trước `,_jsx(_components.code,{children:`\u003c?php wp_head(); ?>`})]}),`\n`,_jsx(_components.li,{children:`Update file`}),`\n`]}),_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Chú ý`}),`: Nếu update theme, bạn sẽ mất code tracking. Khuyến nghị dùng plugin hoặc child theme để tránh vấn đề này.`]})})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`bước-3-cấu-hình-bảo-mật`,children:`Bước 3: Cấu Hình Bảo Mật`}),`\n`,_jsx(Heading,{level:`3`,id:`3-1-thiết-lập-allowed-hostnames`,children:`3.1 Thiết Lập Allowed Hostnames`}),`\n`,_jsx(_components.p,{children:`Allowed Hostnames là danh sách domains được phép gửi tracking requests. Đây là lớp bảo mật quan trọng để chặn abuse.`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Mở Analytics Settings`,children:_jsxs(_components.p,{children:[`Navigate đến `,_jsx(_components.strong,{children:`Settings → Analytics`}),` trong organization settings.`]})}),_jsxs(Step,{title:`Thêm Allowed Hostnames`,children:[_jsxs(_components.p,{children:[`Trong phần `,_jsx(_components.strong,{children:`Security`}),`, tìm `,_jsx(_components.strong,{children:`Allowed Hostnames`}),` và add domains của bạn:`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Ví dụ:`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`example.com`}),` - Chỉ cho phép domain chính xác`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`*.example.com`}),` - Cho phép tất cả subdomains (www, app, blog, etc.)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`localhost`}),` - Cho phép local development (khuyến nghị trong dev)`]}),`\n`]})]}),_jsx(Step,{title:`Save Changes`,children:_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`Save`}),` để áp dụng whitelist.`]})})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Quan trọng`}),`: Nếu không add allowed hostnames, tracking requests sẽ `,_jsx(_components.strong,{children:`BỊ CHẶN`}),`. Đảm bảo add đủ tất cả domains và subdomains bạn sử dụng.`]})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Wildcard Support:`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Pattern`}),_jsx(_components.th,{children:`Cho phép`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`example.com`})}),_jsxs(_components.td,{children:[`Chỉ `,_jsx(_components.code,{children:`example.com`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`www.example.com`})}),_jsxs(_components.td,{children:[`Chỉ `,_jsx(_components.code,{children:`www.example.com`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`*.example.com`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`app.example.com`}),`, `,_jsx(_components.code,{children:`blog.example.com`}),`, etc.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`*`})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Tất cả domains`}),` (KHÔNG khuyến nghị cho production)`]})]})]})]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Development Setup`}),`: Khi develop local, add `,_jsx(_components.code,{children:`localhost`}),` hoặc `,_jsx(_components.code,{children:`127.0.0.1`}),` vào allowed hostnames. Remove khi deploy production.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`3-2-xem-lại-publishable-key`,children:`3.2 Xem Lại Publishable Key`}),`\n`,_jsx(_components.p,{children:`Publishable key được tự động tạo khi bạn enable Analytics. Để xem:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Vào `,_jsx(_components.strong,{children:`Settings → Analytics`})]}),`\n`,_jsxs(_components.li,{children:[`Copy `,_jsx(_components.strong,{children:`Publishable Key`}),` (dạng `,_jsx(_components.code,{children:`li2_pk_...`}),`)`]}),`\n`,_jsx(_components.li,{children:`Paste vào SDK configuration (đã làm ở Bước 2)`}),`\n`]}),`\n`,_jsxs(Note,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Publishable vs Secret Key`}),`:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Publishable key`}),` (`,_jsx(_components.code,{children:`li2_pk_...`}),`): An toàn để expose phía client, dùng cho SDK`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Secret key`}),` (`,_jsx(_components.code,{children:`li2_sk_...`}),`): Chỉ dùng server-side, KHÔNG expose ra client`]}),`\n`]}),_jsx(_components.p,{children:`Conversion tracking SDK chỉ cần publishable key.`})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`bước-4-xác-minh-cài-đặt`,children:`Bước 4: Xác Minh Cài Đặt`}),`\n`,_jsx(Heading,{level:`3`,id:`4-1-test-click-id-capture`,children:`4.1 Test Click ID Capture`}),`\n`,_jsx(_components.p,{children:`Sau khi cài đặt SDK, test xem click ID có được capture đúng không:`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Tạo Test Link`,children:_jsxs(_components.p,{children:[`Từ touchpoint đã enable conversion tracking, copy short link (VD: `,_jsx(_components.code,{children:`li2.link/test-campaign`}),`)`]})}),_jsx(Step,{title:`Click Link Trong Incognito Mode`,children:_jsx(_components.p,{children:`Mở trình duyệt ở chế độ ẩn danh (Incognito) và click vào short link`})}),_jsxs(Step,{title:`Kiểm Tra Cookie`,children:[_jsxs(_components.p,{children:[`Mở `,_jsx(_components.strong,{children:`Developer Tools`}),` (F12) → `,_jsx(_components.strong,{children:`Application`}),` → `,_jsx(_components.strong,{children:`Cookies`})]}),_jsxs(_components.p,{children:[`Tìm cookie tên `,_jsx(_components.code,{children:`li_cid`}),` với value dạng: `,_jsx(_components.code,{children:`cm3w...`})]}),_jsxs(_components.p,{children:[`✅ `,_jsx(_components.strong,{children:`Thành công`}),` nếu cookie tồn tại`]}),_jsxs(_components.p,{children:[`❌ `,_jsx(_components.strong,{children:`Thất bại`}),` nếu không có cookie → Check lại SDK installation`]})]}),_jsxs(Step,{title:`Verify Trong Console`,children:[_jsxs(_components.p,{children:[`Trong `,_jsx(_components.strong,{children:`Console`}),` tab, nhập:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`1`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`li2Analytics`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Nếu SDK load đúng, bạn sẽ thấy object với functions: `,_jsx(_components.code,{children:`trackLead`}),`, `,_jsx(_components.code,{children:`trackSale`})]})]})]}),`\n`,_jsxs(AccordionGroup,{children:[_jsxs(Accordion,{title:`Không thấy li_cid cookie?`,id:`khong-thay-li-cid-cookie`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Nguyên nhân phổ biến:`})}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`SDK chưa load`}),`: Check Network tab, tìm request đến `,_jsx(_components.code,{children:`unpkg.com/@li2/analytics`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Publishable key sai`}),`: Verify key trong script khớp với key trong Settings`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Click link không có uid parameter`}),`: Li2 tự động add parameter `,_jsx(_components.code,{children:`?uid=...`}),` - nếu không có, touchpoint setting có thể chưa đúng`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Third-party cookies bị block`}),`: Một số browser block third-party cookies - `,_jsx(_components.code,{children:`li_cid`}),` là first-party nên không bị ảnh hưởng, nhưng check setting browser`]}),`\n`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Cách fix`}),`: Re-install SDK, verify publishable key, test lại với browser khác`]})]}),_jsxs(Accordion,{title:`li2Analytics undefined trong console?`,id:`li2analytics-undefined-trong-console`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Nguyên nhân:`})}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Script chưa load xong`}),`: Đợi page load hoàn toàn rồi thử lại`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`CDN blocked`}),`: Check Network tab xem request đến unpkg.com có bị block không`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Ad blocker`}),`: Tắt ad blocker và test lại`]}),`\n`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Cách fix`}),`: Check script tag trong HTML source, verify CDN accessible, disable ad blockers`]})]}),_jsxs(Accordion,{title:`Tracking requests bị CORS error?`,id:`tracking-requests-bi-cors-error`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Nguyên nhân:`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Domain hiện tại không có trong `,_jsx(_components.strong,{children:`Allowed Hostnames`})]}),`\n`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Cách fix`}),`:`]}),_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Vào Settings → Analytics → Allowed Hostnames`}),`\n`,_jsxs(_components.li,{children:[`Add domain hiện tại (VD: `,_jsx(_components.code,{children:`example.com`}),`)`]}),`\n`,_jsx(_components.li,{children:`Save và test lại`}),`\n`]}),_jsx(Tip,{children:_jsxs(_components.p,{children:[`CORS error message thường rất rõ ràng: `,_jsx(_components.code,{children:`Request origin 'https://example.com' is not included in the allowed hostnames`}),`. Copy exact domain và add vào allowed list.`]})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`4-2-test-end-to-end-flow-optional`,children:`4.2 Test End-to-End Flow (Optional)`}),`\n`,_jsx(_components.p,{children:`Để test toàn bộ flow từ click → lead tracking:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Mở Console sau khi click vào touchpoint link`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`li2Analytics`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`trackLead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` eventName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Test Lead\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` customerExternalId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"test-user-123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` customerEmail:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"[email protected]\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` customerName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Test User\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Check `,_jsx(_components.strong,{children:`Network`}),` tab - nên thấy POST request đến API endpoint với status `,_jsx(_components.strong,{children:`200 OK`}),`.`]}),`\n`,_jsxs(Warning,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Lưu ý`}),`: Test lead này sẽ được ghi nhận thật trong database. Hiện tại Li2 chưa hỗ trợ delete conversion events qua UI. Khuyến nghị:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Sử dụng `,_jsx(_components.code,{children:`eventName: \"Test ...\"`}),` để dễ phân biệt với real data`]}),`\n`,_jsx(_components.li,{children:`Hoặc test trên development/staging environment trước khi deploy production`}),`\n`]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`hoàn-tất-`,children:`Hoàn Tất! 🎉`}),`\n`,_jsx(_components.p,{children:`Bạn đã cài đặt xong conversion tracking! Các bước tiếp theo:`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Track Lead Events`,icon:`user-plus`,href:`/vi/conversion-tracking/events#lead-tracking`,children:_jsx(_components.p,{children:`Học cách track khi khách hàng sign up hoặc thể hiện quan tâm`})}),_jsx(Card,{title:`Track Sale Events`,icon:`sack-dollar`,href:`/vi/conversion-tracking/events#sale-tracking`,children:_jsx(_components.p,{children:`Học cách track revenue khi khách hàng mua hàng`})}),_jsx(Card,{title:`GTM Integration`,icon:`google`,href:`/vi/conversion-tracking/integrations/google-tag-manager`,children:_jsx(_components.p,{children:`Cài đặt conversion tracking qua Google Tag Manager`})}),_jsx(Card,{title:`Advanced Setup`,icon:`gear-complex`,href:`/vi/conversion-tracking/goals`,children:_jsx(_components.p,{children:`Cấu hình conversion goals và custom events`})}),_jsx(Card,{title:`Track từ app iOS?`,icon:`apple`,href:`/vi/deep-links/mobile-integration#đo-lường-chuyển-đổi-conversion-tracking`,children:_jsxs(_components.p,{children:[`Li2 Swift SDK: API conversion tự gắn về deep-link match (`,_jsx(_components.code,{children:`trackAttributedSale`}),`, `,_jsx(_components.code,{children:`identify`}),`)`]})})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsxs(AccordionGroup,{children:[_jsxs(Accordion,{title:`Conversion tracking toggle bị disabled (xám)?`,id:`conversion-tracking-toggle-bi-disabled-xam`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Nguyên nhân`}),`: Organization chưa có Premium plan.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Cách fix`}),`:`]}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Vào `,_jsx(_components.strong,{children:`Settings → Billing`})]}),`\n`,_jsx(_components.li,{children:`Upgrade lên Premium hoặc cao hơn`}),`\n`,_jsx(_components.li,{children:`Hoặc start Premium Trial để test`}),`\n`]})]}),_jsxs(Accordion,{title:`SDK load chậm, ảnh hưởng page speed?`,id:`sdk-load-cham-anh-huong-page-speed`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Giải pháp`}),`:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`SDK đã được optimize với `,_jsx(_components.code,{children:`defer`}),` loading - không block page render`]}),`\n`,_jsx(_components.li,{children:`CDN global distribution đảm bảo latency thấp`}),`\n`,_jsx(_components.li,{children:`Minified bundle size \u003c 10KB`}),`\n`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Nếu vẫn lo ngại`}),`: Load SDK async sau khi page interactive:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'load'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Inject SDK script here`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),_jsxs(Accordion,{title:`Tracking conversion từ mobile app (iOS / Android)?`,id:`tracking-conversion-tu-mobile-app-ios-android`,children:[_jsxs(_components.p,{children:[`Trang này nói về `,_jsx(_components.strong,{children:`Li2 Analytics SDK (web/JavaScript)`}),` — không chạy trong app native.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`App iOS có deep link`}),`: dùng `,_jsx(_components.strong,{children:`Li2 Swift SDK`}),` (`,_jsx(_components.code,{children:`0.2.0+`}),`). Nó có API conversion định kiểu riêng (`,_jsx(_components.code,{children:`trackDirectLead`}),` / `,_jsx(_components.code,{children:`trackAttributedLead`}),` / `,_jsx(_components.code,{children:`trackAttributedSale`}),` / `,_jsx(_components.code,{children:`identify`}),`) tự gắn về deep-link match qua `,_jsx(_components.code,{children:`Li2.lastClickId`}),` — không cần truyền click ID thủ công. Xem `,_jsx(_components.a,{href:`/vi/deep-links/mobile-integration#%C4%91o-l%C6%B0%E1%BB%9Dng-chuy%E1%BB%83n-%C4%91%E1%BB%95i-conversion-tracking`,children:`Đo lường chuyển đổi trong Tích Hợp App`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Android / nền tảng khác`}),`, hoặc khi không có deep link: dùng `,_jsx(_components.strong,{children:`server-side tracking`}),` với secret key (`,_jsx(_components.code,{children:`li2_sk_...`}),`) và truyền `,_jsx(_components.code,{children:`clickId`}),` thủ công. Xem `,_jsx(_components.a,{href:`/vi/conversion-tracking/events#c%C3%A1ch-track-lead`,children:`Events Tracking - Server-side`}),`.`]}),`\n`]})]}),_jsxs(Accordion,{title:`Làm sao biết touchpoint nào đã enable conversion tracking?`,id:`lam-sao-biet-touchpoint-nao-da-enable-conversion-tracking`,children:[_jsxs(_components.p,{children:[`Trong `,_jsx(_components.strong,{children:`Touch-Points list`}),`, tìm icon 📊 bên cạnh touchpoint name. Icon này chỉ xuất hiện khi conversion tracking đã được enabled.`]}),_jsxs(_components.p,{children:[`Hoặc filter touchpoints với `,_jsx(_components.strong,{children:`Advanced Filters → Conversion Tracking = Enabled`}),`.`]})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best Practices`}),`\n`,_jsxs(Tip,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`1. Enable tracking có chọn lọc`}),`: Chỉ enable cho touchpoints quan trọng để data sạch và dễ analyze.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`2. Test trong development`}),`: Luôn add `,_jsx(_components.code,{children:`localhost`}),` vào allowed hostnames khi develop, remove khi deploy production.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`3. Monitor setup`}),`: Check Analytics dashboard thường xuyên trong tuần đầu sau setup để catch issues sớm.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`4. Document your setup`}),`: Ghi lại publishable key, allowed hostnames ở đâu để team khác có thể maintain.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`5. Secure your keys`}),`: Publishable key an toàn cho client, nhưng KHÔNG commit secret keys vào Git.`]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Hướng Dẫn Cài Đặt Conversion Tracking","description":"Hướng dẫn từng bước để bật conversion tracking cho touchpoints và tích hợp Li2 Analytics SDK vào website hoặc ứng dụng của bạn.","sidebarTitle":"Cài Đặt","icon":"screwdriver-wrench","href":"/vi/conversion-tracking/setup"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Hướng Dẫn Cài Đặt Conversion Tracking","slug":"hướng-dẫn-cài-đặt-conversion-tracking","depth":1,"children":[]},{"title":"Yêu Cầu Trước Khi Bắt Đầu","slug":"yêu-cầu-trước-khi-bắt-đầu","depth":2,"children":[]},{"title":"Tổng Quan Quy Trình Cài Đặt","slug":"tổng-quan-quy-trình-cài-đặt","depth":2,"children":[]},{"title":"Bước 1: Bật Conversion Tracking cho Touchpoint","slug":"bước-1-bật-conversion-tracking-cho-touchpoint","depth":2,"children":[{"title":"1.1 Truy Cập Touchpoint Settings","slug":"1-1-truy-cập-touchpoint-settings","depth":3,"children":[]},{"title":"1.2 Kích Hoạt Conversion Tracking","slug":"1-2-kích-hoạt-conversion-tracking","depth":3,"children":[]}]},{"title":"Bước 2: Cài Đặt Li2 Analytics SDK","slug":"bước-2-cài-đặt-li2-analytics-sdk","depth":2,"children":[{"title":"Cài Đặt cho Website HTML Thông Thường","slug":"cài-đặt-cho-website-html-thông-thường","depth":3,"children":[],"tabId":"html-%2F-javascript"},{"title":"Cài Đặt cho WordPress","slug":"cài-đặt-cho-wordpress","depth":3,"children":[],"tabId":"wordpress"}]},{"title":"Bước 3: Cấu Hình Bảo Mật","slug":"bước-3-cấu-hình-bảo-mật","depth":2,"children":[{"title":"3.1 Thiết Lập Allowed Hostnames","slug":"3-1-thiết-lập-allowed-hostnames","depth":3,"children":[]},{"title":"3.2 Xem Lại Publishable Key","slug":"3-2-xem-lại-publishable-key","depth":3,"children":[]}]},{"title":"Bước 4: Xác Minh Cài Đặt","slug":"bước-4-xác-minh-cài-đặt","depth":2,"children":[{"title":"4.1 Test Click ID Capture","slug":"4-1-test-click-id-capture","depth":3,"children":[]},{"title":"4.2 Test End-to-End Flow (Optional)","slug":"4-2-test-end-to-end-flow-optional","depth":3,"children":[]}]},{"title":"Hoàn Tất! 🎉","slug":"hoàn-tất-","depth":2,"children":[]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[]},{"title":"Best Practices","slug":"best-practices","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/ftc/3c01fd7bd2da0f78/scripts/create-new-page.js","/_mintlify/custom/ftc/1d0fdbfdd107c01e/scripts/find-orphaned-files.js","/_mintlify/custom/ftc/0ce9d3f913f6168c/scripts/migrate-content.js","/_mintlify/custom/ftc/67e3370e426eb475/scripts/validate-docs-references.js","/_mintlify/custom/ftc/8d6a5ade900e8e9e/scripts/validate-i18n-parity.js"],"subdomain":"ftc","siteName":"Li2.ai Documentation","title":"Hướng Dẫn Cài Đặt Conversion Tracking - Li2.ai Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"vi":{"href":"/vi/conversion-tracking/setup","matchLevel":0}}},"lastModified":"2026-06-19T07:20:29.406Z","originalFileLocation":"vi/conversion-tracking/setup.mdx","locale":"vi"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Hướng dẫn từng bước để bật conversion tracking cho touchpoints và tích hợp Li2 Analytics SDK vào website hoặc ứng dụng của bạn.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Li2.ai Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/ftc/-EuQqzbCumVPK2Wd/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/ftc/-EuQqzbCumVPK2Wd/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/ftc/-EuQqzbCumVPK2Wd/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/ftc/-EuQqzbCumVPK2Wd/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/ftc/-EuQqzbCumVPK2Wd/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/ftc/-EuQqzbCumVPK2Wd/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/ftc/-EuQqzbCumVPK2Wd/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/ftc/-EuQqzbCumVPK2Wd/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/ftc/-EuQqzbCumVPK2Wd/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Hướng Dẫn Cài Đặt Conversion Tracking - Li2.ai Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Hướng dẫn từng bước để bật conversion tracking cho touchpoints và tích hợp Li2 Analytics SDK vào website hoặc ứng dụng của bạn.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Li2.ai Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.li2.ai/vi/conversion-tracking/setup\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://ftc.mintlify.site/_mintlify/api/og/v2?division=%C4%90o+L%C6%B0%E1%BB%9Dng+Chuy%E1%BB%83n+%C4%90%E1%BB%95i\u0026amp;title=H%C6%B0%E1%BB%9Bng+D%E1%BA%ABn+C%C3%A0i+%C4%90%E1%BA%B7t+Conversion+Tracking\u0026amp;description=H%C6%B0%E1%BB%9Bng+d%E1%BA%ABn+t%E1%BB%ABng+b%C6%B0%E1%BB%9Bc+%C4%91%E1%BB%83+b%E1%BA%ADt+conversion+tracking+cho+touchpoints+v%C3%A0+t%C3%ADch+h%E1%BB%A3p+Li2+Analytics+SDK+v%C3%A0o+website+ho%E1%BA%B7c+%E1%BB%A9ng+d%E1%BB%A5ng+c%E1%BB%A7a+b%E1%BA%A1n.\u0026amp;theme=b1add249619a45f843b2cb3d\u0026amp;signature=9b2ecd52f2184d87a22ef2fd0535b6157b89db176814b458cba04a81b1676c05\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Hướng Dẫn Cài Đặt Conversion Tracking - Li2.ai Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Hướng dẫn từng bước để bật conversion tracking cho touchpoints và tích hợp Li2 Analytics SDK vào website hoặc ứng dụng của bạn.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://ftc.mintlify.site/_mintlify/api/og/v2?division=%C4%90o+L%C6%B0%E1%BB%9Dng+Chuy%E1%BB%83n+%C4%90%E1%BB%95i\u0026amp;title=H%C6%B0%E1%BB%9Bng+D%E1%BA%ABn+C%C3%A0i+%C4%90%E1%BA%B7t+Conversion+Tracking\u0026amp;description=H%C6%B0%E1%BB%9Bng+d%E1%BA%ABn+t%E1%BB%ABng+b%C6%B0%E1%BB%9Bc+%C4%91%E1%BB%83+b%E1%BA%ADt+conversion+tracking+cho+touchpoints+v%C3%A0+t%C3%ADch+h%E1%BB%A3p+Li2+Analytics+SDK+v%C3%A0o+website+ho%E1%BA%B7c+%E1%BB%A9ng+d%E1%BB%A5ng+c%E1%BB%A7a+b%E1%BA%A1n.\u0026amp;theme=b1add249619a45f843b2cb3d\u0026amp;signature=9b2ecd52f2184d87a22ef2fd0535b6157b89db176814b458cba04a81b1676c05\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/ftc/-EuQqzbCumVPK2Wd/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Li2.ai Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#7C3AED\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.li2.ai/vi/conversion-tracking/setup\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/vi/conversion-tracking/setup.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.li2.ai/#organization\",\"name\":\"Li2.ai Documentation\",\"url\":\"https://docs.li2.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/ftc/3ap442ix0jtT2vEo/shared/logos/light.png?fit=max\u0026auto=format\u0026n=3ap442ix0jtT2vEo\u0026q=85\u0026s=43c97af8b1705fa2ed279991dd0c65dc\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.li2.ai#website\",\"name\":\"Li2.ai Documentation\",\"url\":\"https://docs.li2.ai\",\"publisher\":{\"@id\":\"https://docs.li2.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.li2.ai/vi/conversion-tracking/setup#webpage\",\"url\":\"https://docs.li2.ai/vi/conversion-tracking/setup\",\"name\":\"Hướng Dẫn Cài Đặt Conversion Tracking\",\"description\":\"Hướng dẫn từng bước để bật conversion tracking cho touchpoints và tích hợp Li2 Analytics SDK vào website hoặc ứng dụng của bạn.\",\"dateModified\":\"2026-06-19T07:20:29.406Z\",\"isPartOf\":{\"@id\":\"https://docs.li2.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.li2.ai/vi/conversion-tracking/setup#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.li2.ai/vi/conversion-tracking/setup#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Đo Lường Chuyển Đổi\",\"item\":\"https://docs.li2.ai/vi/conversion-tracking/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hướng Dẫn Cài Đặt Conversion Tracking\",\"item\":\"https://docs.li2.ai/vi/conversion-tracking/setup\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.li2.ai/vi/conversion-tracking/setup#article\",\"headline\":\"Hướng Dẫn Cài Đặt Conversion Tracking\",\"name\":\"Hướng Dẫn Cài Đặt Conversion Tracking\",\"description\":\"Hướng dẫn từng bước để bật conversion tracking cho touchpoints và tích hợp Li2 Analytics SDK vào website hoặc ứng dụng của bạn.\",\"url\":\"https://docs.li2.ai/vi/conversion-tracking/setup\",\"mainEntityOfPage\":{\"@id\":\"https://docs.li2.ai/vi/conversion-tracking/setup#webpage\"},\"dateModified\":\"2026-06-19T07:20:29.406Z\",\"publisher\":{\"@id\":\"https://docs.li2.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.li2.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Li2.ai Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Li2.ai Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/vi/conversion-tracking/setup.md","siteName":"Li2.ai Documentation","nav":{"global":null,"languages":[{"language":"vi","default":true,"tabs":[{"tab":"Trung tâm hỗ trợ","pages":[{"title":"Trung tâm hỗ trợ","href":"/vi/guide"}]},{"tab":"Tài liệu cho Developers","groups":[{"group":"Bắt Đầu","pages":[{"title":"Tổng Quan Nền Tảng","sidebarTitle":"Tổng Quan","icon":"compass","href":"/vi/getting-started/overview"},{"title":"Tạo Tài Khoản Li2","sidebarTitle":"Tạo Tài Khoản","icon":"user-plus","href":"/vi/getting-started/account-setup"},{"title":"Tổ Chức","sidebarTitle":"Tổ Chức","icon":"users","href":"/vi/getting-started/organizations"},{"title":"Hướng Dẫn Nhanh","sidebarTitle":"Hướng Dẫn Nhanh","icon":"rocket","href":"/vi/getting-started/quick-start"},{"title":"Tổng Quan Dashboard","sidebarTitle":"Dashboard","icon":"chart-mixed","href":"/vi/getting-started/dashboard"}]},{"group":"Đo Lường Chuyển Đổi","pages":[{"title":"Tổng Quan Đo Lường Chuyển Đổi","description":"Hiểu về conversion tracking trong Li2 - theo dõi hành trình khách hàng từ click đầu tiên đến giao dịch hoàn tất với attribution chính xác và báo cáo USD/VND.","sidebarTitle":"Tổng Quan","icon":"chart-line-up","href":"/vi/conversion-tracking/overview"},{"title":"Hướng Dẫn Cài Đặt Conversion Tracking","sidebarTitle":"Cài Đặt","icon":"screwdriver-wrench","href":"/vi/conversion-tracking/setup"},{"title":"Hướng Dẫn Track Events","description":"Hướng dẫn chi tiết cách track lead events (khách hàng tiềm năng) và sale events (giao dịch) với Li2 Analytics SDK.","sidebarTitle":"Track Events","icon":"chart-mixed","href":"/vi/conversion-tracking/events"},{"group":"Integrations","pages":[{"title":"Tích Hợp Google Tag Manager","sidebarTitle":"Google Tag Manager","icon":"google","href":"/vi/conversion-tracking/integrations/google-tag-manager"}]},{"title":"Conversion Goals (Đang Phát Triển)","sidebarTitle":"Conversion Goals","icon":"bullseye-arrow","href":"/vi/conversion-tracking/goals"}]},{"group":"Deep Link (Liên kết sâu)","pages":[{"title":"Tổng Quan Deep Link","sidebarTitle":"Tổng Quan","icon":"link","href":"/vi/deep-links/overview"},{"title":"Cấu Hình Domain \u0026 File Xác Minh","sidebarTitle":"Cấu Hình Domain","icon":"globe","href":"/vi/deep-links/domain-setup"},{"title":"Tích Hợp Deep Link Trên iOS \u0026 Android","sidebarTitle":"Tích Hợp App","icon":"mobile","href":"/vi/deep-links/mobile-integration"},{"title":"Đo Lường Chuyển Đổi Cho Deep Link","sidebarTitle":"Đo Lường Chuyển Đổi","icon":"chart-line","href":"/vi/deep-links/conversion"},{"title":"API: POST /track/open","sidebarTitle":"API /track/open","icon":"code","href":"/vi/deep-links/track-open-api"},{"title":"Khắc Phục Sự Cố Deep Link","sidebarTitle":"Khắc Phục Sự Cố","icon":"wrench","href":"/vi/deep-links/troubleshooting"}]},{"group":"Touchpoint (Điểm Chạm)","hidden":true,"pages":[{"title":"Tổng Quan Touch-Points","sidebarTitle":"Tổng Quan","icon":"diamond","href":"/vi/core-features/touchpoints/overview"},{"title":"Tạo Touch-Points","sidebarTitle":"Tạo","icon":"plus","href":"/vi/core-features/touchpoints/creating"},{"title":"Liên Kết Rút Gọn","sidebarTitle":"Liên Kết Rút Gọn","icon":"link","href":"/vi/core-features/touchpoints/short-links"},{"title":"Cách Tạo QR Code","sidebarTitle":"Cách Tạo QR Code ","href":"/vi/core-features/touchpoints/qr-codes"},{"title":"Managing Touchpoints","href":"/vi/core-features/touchpoints/managing"},{"title":"Tên miền Tùy chỉnh","sidebarTitle":" Tùy chỉnh Tên miền","href":"/vi/core-features/touchpoints/custom-domains"}]},{"group":"Quản Lý \u0026 Tổ Chức","hidden":true,"pages":[{"title":"Tổng Quan Collections","sidebarTitle":"Tổng Quan","icon":"folder-tree","href":"/vi/core-features/collections/overview"},{"title":"Làm thế nào để thêm hoặc xóa Tag (thẻ) trong Li2","href":"/vi/core-features/tags/overview"}]},{"group":"Phân Tích \u0026 Báo Cáo","hidden":true,"pages":[{"title":"Analytics \u0026 Tracking Overview","sidebarTitle":"Phân Tích - Thống Kê ","href":"/vi/analytics/overview"},{"title":"Phân tích \u0026 Báo cáo (Analytics) ","href":"/vi/analytics/dashboard"},{"title":"Nhân Khẩu Học Người Truy Cập","sidebarTitle":"Nhân Khẩu Học","icon":"users","href":"/vi/analytics/demographics"},{"title":"Bộ Lọc \u0026 Khoảng Ngày","sidebarTitle":"Bộ Lọc","icon":"filter","href":"/vi/analytics/filters"}]}]}]}]},"basePath":"","title":"Hướng Dẫn Cài Đặt Conversion Tracking - Li2.ai Documentation","deploymentId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","buildId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","dynamics":[],"chunks":[]}