You may have already heard about the General Data Protection Regulation (GDPR) that has gone into effect for users in the European Economic Area (EEA). We’ve taken steps to make sure that we comply with GDPR and other privacy regulations, and that you do too.
Visitors to your site with IP addresses in the following countries are not tracked by default:
If you would like to give your EEA visitors the option to be tracked, you can create a pop-up or other feature that lets them opt-in to be tracked - with user consent, you can record their consent in a cookie. Here's an example JavaScript:
<script>
(function(w,d) {
function writeCookie(key, value, domain) {
d.cookie = key + '=' + value + (domain ? '; domain=' + domain : '') + '; path=/;';
}
// Set the cookie(_ysb_dnt) on all subdomains so that it can be read by our tracking pixel.
var subdomains = window.location.hostname.split('.');
var domain = '.' + subdomains.join('.');
writeCookie("_ysb_dnt", "X", domain);
})(window, document);
</script>
Note: In the code above, replace X with 1 (for customers opting out of tracking) or 0 (for customers opting in to tracking), and replace the domain with your website's actual domain (like your-website-here.net).
If the _ysb_dnt cookie is absent, or has a value of 1, visitors to your site with EEA IP addresses will not be recorded in your store stats or Google Analytics. Please contact your developer if you need help implementing the consent feature or cookie. Don’t have a developer yet? Visit our Merchant Solutions Developer Network to find someone who will be happy to help you out.