{"id":524,"date":"2025-04-17T06:37:34","date_gmt":"2025-04-17T06:37:34","guid":{"rendered":"http:\/\/localhost:8091\/?page_id=524"},"modified":"2025-07-07T09:46:31","modified_gmt":"2025-07-07T09:46:31","slug":"privacy-and-security-verify-user-consent-api","status":"publish","type":"page","link":"https:\/\/www.uxtweak.com\/help\/privacy-and-security-verify-user-consent-api\/","title":{"rendered":"Verify user consent API (GDPR)"},"content":{"rendered":"\n<p class=\"text-block\"><a href=\"https:\/\/www.uxtweak.com\/legal\/gdpr-compliance\">Learn more about GDPR.<\/a>&nbsp;GDPR is a piece of legislation in the EU that demands you have the consent of users before you record any of their personal data. This doesn&#8217;t mean all inputs from users are sensitive, but getting consent is something that you need to pay attention to when setting up a Website Testing or Session Recording study that could also collect personal information. After the visitor gives their consent, you pass it through our API, which enables recording. Getting user consent isn&#8217;t required in countries outside the EU, but we recommend it nevertheless. It&#8217;s good when users have control over how their personal data is being collected and processed.<\/p>\n\n\n<h2 id=\"form-inputs-consent\" class=\"heading-block\" tabindex=\"0\">Form inputs consent<a class=\"copy-link\" title=\"Copy link\" data-id=\"form-inputs-consent\">&nbsp;<img decoding=\"async\" src=\"https:\/\/help.uxtweak.com\/wp-content\/themes\/uxtweak\/public\/assets\/images\/icons\/link.svg\" alt=\"Copy link\" \/><\/a><\/h2>\n\n\n<p class=\"text-block\">This is how you get consent from visitors to record forms and inputs.<\/p>\n\n\n<div class=\"code-block\"><div class=\"code-block-header\"><div class=\"code-block-title\" style=\"background-color: #ffe0b2;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M4.09998 2H19.9C20.5 2 21 2.5 20.9 3.1L19.1 19.3C19.1 19.7 18.8 20 18.4 20.2L12.3 21.9C12.1 22 11.9 22 11.8 21.9L5.69998 20.2C5.29998 20.1 4.99998 19.8 4.99998 19.3L3.09998 3.1C3.09998 2.5 3.49998 2 4.09998 2Z\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><path d=\"M10.6 7V16L7.5 15.1\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><path d=\"M16.5 7L13.4 7.4V12.4L16.5 11.9V15.1L12.9 16\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><\/svg> JavaScript<\/div><button class=\"copy-button btn btn-transparent\">Copy<\/button><\/div><pre class=\"language-javascript line-numbers code\"><code class=\"language-javascript\">&lt;script&gt;\n\t\/\/ set your consent text here\n\tvar consentText = &#039;I agree that my personal data will...&#039;;\n\n\t\/\/ choose one of these\n\tvar clientDecision = true; \/\/ if user gave consent to have forms recorded\n\tvar clientDecision = false; \/\/ otherwise\n\n\tuxtr(&#039;consentForms&#039;, clientDecision, consentText);\n&lt;\/script&gt;<\/code><\/pre><\/div>\n\n<h2 id=\"ip-address-consent\" class=\"heading-block\" tabindex=\"0\">IP address consent<a class=\"copy-link\" title=\"Copy link\" data-id=\"ip-address-consent\">&nbsp;<img decoding=\"async\" src=\"https:\/\/help.uxtweak.com\/wp-content\/themes\/uxtweak\/public\/assets\/images\/icons\/link.svg\" alt=\"Copy link\" \/><\/a><\/h2>\n\n\n<p class=\"text-block\">This is how you get consent from visitors to record their IP address.<\/p>\n\n\n<div class=\"code-block\"><div class=\"code-block-header\"><div class=\"code-block-title\" style=\"background-color: #ffe0b2;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M4.09998 2H19.9C20.5 2 21 2.5 20.9 3.1L19.1 19.3C19.1 19.7 18.8 20 18.4 20.2L12.3 21.9C12.1 22 11.9 22 11.8 21.9L5.69998 20.2C5.29998 20.1 4.99998 19.8 4.99998 19.3L3.09998 3.1C3.09998 2.5 3.49998 2 4.09998 2Z\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><path d=\"M10.6 7V16L7.5 15.1\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><path d=\"M16.5 7L13.4 7.4V12.4L16.5 11.9V15.1L12.9 16\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><\/svg> JavaScript<\/div><button class=\"copy-button btn btn-transparent\">Copy<\/button><\/div><pre class=\"language-javascript line-numbers code\"><code class=\"language-javascript\">&lt;script&gt;\n\t\/\/ set your consent text here\n\tvar consentText = &#039;I agree that my personal data will...&#039;;\n\n\t\/\/ choose one of these\n\tvar clientDecision = true; \/\/ if user gave consent to have IP address recorded\n\tvar clientDecision = false; \/\/ otherwise\n\n\tuxtr(&#039;consentIp&#039;, clientDecision, consentText);\n&lt;\/script&gt;<\/code><\/pre><\/div>\n\n<h2 id=\"user-identification-consent\" class=\"heading-block\" tabindex=\"0\">User identification consent<a class=\"copy-link\" title=\"Copy link\" data-id=\"user-identification-consent\">&nbsp;<img decoding=\"async\" src=\"https:\/\/help.uxtweak.com\/wp-content\/themes\/uxtweak\/public\/assets\/images\/icons\/link.svg\" alt=\"Copy link\" \/><\/a><\/h2>\n\n\n<p class=\"text-block\">This is how you get consent from visitors to be identified through the API.<\/p>\n\n\n<div class=\"code-block\"><div class=\"code-block-header\"><div class=\"code-block-title\" style=\"background-color: #ffe0b2;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M4.09998 2H19.9C20.5 2 21 2.5 20.9 3.1L19.1 19.3C19.1 19.7 18.8 20 18.4 20.2L12.3 21.9C12.1 22 11.9 22 11.8 21.9L5.69998 20.2C5.29998 20.1 4.99998 19.8 4.99998 19.3L3.09998 3.1C3.09998 2.5 3.49998 2 4.09998 2Z\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><path d=\"M10.6 7V16L7.5 15.1\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><path d=\"M16.5 7L13.4 7.4V12.4L16.5 11.9V15.1L12.9 16\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><\/svg> JavaScript<\/div><button class=\"copy-button btn btn-transparent\">Copy<\/button><\/div><pre class=\"language-javascript line-numbers code\"><code class=\"language-javascript\">&lt;script&gt;\n\t\/\/ set your consent text here\n\tvar consentText = &#039;I agree that my personal data will...&#039;;\n\n\t\/\/ choose one of these\n\tvar clientDecision = true; \/\/ if user gave consent to be identified via API\n\tvar clientDecision = false; \/\/ otherwise\n\n\tuxtr(&#039;consentApi&#039;, clientDecision, consentText);\n&lt;\/script&gt;<\/code><\/pre><\/div>\n\n<h2 id=\"gdpr-safe-data\" class=\"heading-block\" tabindex=\"0\">GDPR safe data<a class=\"copy-link\" title=\"Copy link\" data-id=\"gdpr-safe-data\">&nbsp;<img decoding=\"async\" src=\"https:\/\/help.uxtweak.com\/wp-content\/themes\/uxtweak\/public\/assets\/images\/icons\/link.svg\" alt=\"Copy link\" \/><\/a><\/h2>\n\n\n<p class=\"text-block\">Adding the attribute&nbsp;<code class=\"language-html\">data-uxtr=\"safe\"<\/code>&nbsp;will notify UXtweak that its content isn&#8217;t sensitive and can be recorded regardless of consent.<\/p>\n\n\n<div class=\"code-block\"><div class=\"code-block-header\"><div class=\"code-block-title\" style=\"background-color: #ffccbc;\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M4.09998 2H19.9C20.5 2 21 2.5 20.9 3.1L19.1 19.3C19.1 19.7 18.8 20 18.4 20.2L12.3 21.9C12.1 22 11.9 22 11.8 21.9L5.69998 20.2C5.29998 20.1 4.99998 19.8 4.99998 19.3L3.09998 3.1C3.09998 2.5 3.49998 2 4.09998 2Z\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><path d=\"M16.2 6.7998H7.80005L8.20005 11.1998H15.8L15.2 16.1998L11.8 17.1998L8.20005 16.1998V14.1998\" stroke=\"#414237\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><\/svg> HTML<\/div><button class=\"copy-button btn btn-transparent\">Copy<\/button><\/div><pre class=\"language-html line-numbers code\"><code class=\"language-html\">&lt;p data-uxtr=&quot;safe&quot;&gt;\n\tRoses are red, violets are blue, UXtweak&#039;s great and so are you.\n&lt;\/p&gt;<\/code><\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Learn more about GDPR.&nbsp;GDPR is a piece of legislation in the EU that demands you have the consent of users before you record any of their personal data. This doesn&#8217;t mean all inputs from users are sensitive, but getting consent is something that you need to pay attention to when setting up a Website Testing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":66,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"content-type":"","inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-524","page","type-page","status-publish","hentry","category-privacy-and-security"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.uxtweak.com\/help\/wp-json\/wp\/v2\/pages\/524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.uxtweak.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.uxtweak.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.uxtweak.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.uxtweak.com\/help\/wp-json\/wp\/v2\/comments?post=524"}],"version-history":[{"count":7,"href":"https:\/\/www.uxtweak.com\/help\/wp-json\/wp\/v2\/pages\/524\/revisions"}],"predecessor-version":[{"id":3014,"href":"https:\/\/www.uxtweak.com\/help\/wp-json\/wp\/v2\/pages\/524\/revisions\/3014"}],"wp:attachment":[{"href":"https:\/\/www.uxtweak.com\/help\/wp-json\/wp\/v2\/media?parent=524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.uxtweak.com\/help\/wp-json\/wp\/v2\/categories?post=524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.uxtweak.com\/help\/wp-json\/wp\/v2\/tags?post=524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}