Tuân thủ quy định một cách dễ dàng
Switas Consent Widget v2 là giải pháp tối ưu để quản lý sự đồng ý của người dùng trên website của bạn. Tiện ích mã nguồn mở, miễn phí của chúng tôi giúp bạn tuân thủ luật về quyền riêng tư đồng thời mang lại trải nghiệm người dùng liền mạch.
Cách tích hợp Free Cookie Consent vào website của bạn
- Sao chép mã đã tạo ở Bước 3 phía trên và thêm vào website của bạn.
- Gắn thẻ cho mọi
<script> JavaScript bạn đang dùng bằng cách đổi type="text/javascript" thành type="text/plain".
- Với mỗi
<script> đã gắn thẻ, thêm mức đồng ý tương ứng:
data-cookie-consent="strictly-necessary" cho các tập lệnh thực sự cần thiết, được tải bất kể lựa chọn của người dùng
data-cookie-consent="functionality" cho các tập lệnh chức năng, chẳng hạn tập lệnh tùy chọn ngôn ngữ
data-cookie-consent="tracking" cho các tập lệnh theo dõi, chẳng hạn Google Analytics 4
data-cookie-consent="targeting" cho các tập lệnh nhắm mục tiêu, chẳng hạn Google Ads Remarketing, Meta Pixel
Ví dụ sử dụng
<!-- Login Cookies -->
<script type="text/plain" src="/js/login-session.js"></script>
<!-- Google Analytics -->
<script type="text/plain">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', GOOGLE_PROPERTY_ID_GOES_HERE, 'auto');
ga('send', 'pageview');
</script>
Vì sao chọn Switas Consent Widget v2?
- Miễn phí sử dụng: Luôn miễn phí và bạn cứ thoải mái hỏi về việc tích hợp. Xem tại Github: https://github.com/switaslabs/switas-consent-v2
- Tích hợp dễ dàng: Thêm vào website của bạn trong vài phút với hướng dẫn dễ làm theo.
- Thiết kế tùy chỉnh được: Điều chỉnh tiện ích cho phù hợp với diện mạo website của bạn.
- Giao diện thân thiện: Các tùy chọn rõ ràng để người dùng đồng ý hoặc rút lại sự đồng ý.
- Sẵn sàng cho quy định: Tuân thủ GDPR, CCPA và các luật quyền riêng tư lớn khác.
Tính năng chính
- Cài đặt dễ dàng: Quy trình cài đặt nhanh chóng và đơn giản.
- Tùy chỉnh linh hoạt: Điều chỉnh màu sắc, phông chữ và văn bản cho phù hợp thương hiệu.
- Thiết kế đáp ứng: Hoạt động liền mạch trên mọi thiết bị.
- Tích hợp phân tích: Theo dõi sự đồng ý và tùy chọn của người dùng.
- Hỗ trợ đa ngôn ngữ: Phục vụ khán giả toàn cầu với nhiều tùy chọn ngôn ngữ.
Quản lý sự đồng ý của người dùng
Cho phép người dùng dễ dàng chấp nhận, từ chối hoặc tùy chỉnh cài đặt quyền riêng tư. Đảm bảo tuân thủ các quy định quyền riêng tư mới nhất. Ý tưởng và cách triển khai của tiện ích này dựa trên công cụ Free Cookie Consent
Cần trợ giúp?
Hãy xem tài liệu của chúng tôi để biết hướng dẫn chi tiết và mẹo khắc phục sự cố. Nếu có bất kỳ câu hỏi nào, cứ thoải mái liên hệ với chúng tôi.
Về Switas
Tại Switas, chúng tôi tận tâm cung cấp các giải pháp đổi mới giúp doanh nghiệp phát triển và thịnh vượng trong môi trường số. Cam kết về quyền riêng tư và trải nghiệm người dùng thúc đẩy chúng tôi tạo ra những công cụ vừa mạnh mẽ vừa dễ sử dụng.
Xem trước đồng ý cookie
Xem trước đồng ý cookie
"use strict";
var _BASE_URL = '';
var script_config = void 0,
user_scripts = [],
use_php = !0,
php_result_path = _BASE_URL + "consent-preview.php",
properties_changed = document.createEvent("Event");
function create_demo(b) {
for (var c = document.querySelectorAll("iframe"), a = 0; a < c.length; a++) {
var d = c[a];
!0 === use_php ? (d.src = php_result_path + "?data=" + b64EncodeUnicode(b)) : (d.src = _BASE_URL + "result/" + b64EncodeUnicode(b));
}
}
function b64EncodeUnicode(a) {
return btoa(
encodeURIComponent(a).replace(/%([0-9A-F]{2})/g, function (b, a) {
return String.fromCharCode("0x" + a);
})
);
}
function clean_script_code_types(a) {
return (a = (a = a.replace(new RegExp(" type=('|\")(.*?)('|\")", "g"), "")).replace(new RegExp("=('|\")(.*?)('|\")", "g"), ""));
}
function prepare_script_code(a, b) {
return a.replace(new RegExp("" + d.type + ")";
var c = document.createElement("button");
c.classList.add("btn"),
c.classList.add("btn-primary"),
(c.innerHTML = "Delete"),
b.appendChild(e),
b.appendChild(c),
a.appendChild(b),
c.addEventListener("click", function () {
delete user_scripts[f], display_scripts(), document.dispatchEvent(properties_changed);
});
});
}
properties_changed.initEvent("properties_changed", !0, !0),
document.addEventListener("properties_changed", function () {
var a = JSON.stringify(script_config),
b = _BASE_URL.replace("http:", "");
b = b.replace("https:", "");
var c = compile_user_scripts();
(document.querySelector("#user_code").innerHTML =
'\n<\/script>\n\ndocument.addEventListener(\'DOMContentLoaded\', function () {\ncookieconsent.run(' +
a +
");\n});\n<\/script>" +
c +
'\n\n
Update cookies preferences\n'),
create_demo(a);
}),
(function () {
script_config = { notice_banner_type: "headline", consent_type: "express", palette: "dark", language: "en", page_load_consent_levels: ["strictly-necessary"] };
var d = document.querySelector("#website_name");
d.addEventListener("input", function () {
(script_config.website_name = d.value), document.dispatchEvent(properties_changed);
});
var e = document.querySelectorAll('[name="notice_banner"]');
[].forEach.call(e, function (a) {
a.addEventListener("change", function () {
(script_config.notice_banner_type = a.value), document.dispatchEvent(properties_changed);
});
});
var f = document.querySelectorAll('[name="consent_type"]');
[].forEach.call(f, function (a) {
a.addEventListener("change", function () {
(script_config.consent_type = a.value),
"implied" == a.value
? (script_config.page_load_consent_levels = ["strictly-necessary", "functionality", "tracking", "targeting"])
: "express" == a.value && (script_config.page_load_consent_levels = ["strictly-necessary"]),
document.dispatchEvent(properties_changed);
});
});
var b = document.querySelectorAll('input[name="palette"]');
for (let a = 0; a < b.length; a++) {
let g = b[a];
g.addEventListener("click", function () {
(script_config.palette = g.value), document.dispatchEvent(properties_changed);
});
}
var h = document.querySelector('[name="language"]');
h.addEventListener("change", function () {
(script_config.language = h.value), document.dispatchEvent(properties_changed);
});
var i = document.querySelector("#include_privacy_policy"),
j = document.querySelector("#privacy_policy_link"),
k = document.querySelector("#privacy_policy_link_input");
(j.style.display = "none"),
i.addEventListener("change", function () {
!0 === i.checked ? ((j.style.display = "block"), (k.value = "")) : (delete script_config.website_privacy_policy_url, document.dispatchEvent(properties_changed), (j.style.display = "none"));
}),
k.addEventListener("input", function () {
(script_config.website_privacy_policy_url = k.value), document.dispatchEvent(properties_changed);
});
var c = document.querySelector("#addUserScript");
c &&
c.addEventListener("click", function () {
var c = document.querySelector('[name="script_name"]'),
a = c.value,
b = document.querySelector('[name="script_type"]:checked'),
d = "strictly-necessary";
d = null !== b ? b.value || "strictly-necessary" : (b = document.querySelector('[name="script_type"]')).value;
var e = document.querySelector('[name="script_code"]'),
f = e.value,
h = f.indexOf(" -1) {
(g.innerHTML = ""), a.length < 1 && (a = "Unnamed script");
var i = clean_script_code_types(f);
user_scripts.push({ name: a, type: d, code: i }), (c.value = ""), (e.value = ""), display_scripts(), document.dispatchEvent(properties_changed);
} else g.innerHTML = "Invalid code error";
}),
(script_config.notice_banner_reject_button_hide = !1),
(script_config.preferences_center_close_button_hide = !1),
(script_config.page_refresh_confirmation_buttons = !1),
document.dispatchEvent(properties_changed);
})();
document.getElementById('user-code-copy-button').addEventListener('click', function(e) {
var clipboard = new ClipboardJS('#user-code-copy-button', {
text: function(trigger) {
return document.getElementById('user_code').value;
}
});
clipboard.on('success', function(e) {
alert('Copied.');
});
});