{"id":18698697,"date":"2025-10-28T17:44:58","date_gmt":"2025-10-28T17:44:58","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/run-code-on-reject-after-previous-acceptance\/"},"modified":"2025-10-28T17:44:58","modified_gmt":"2025-10-28T17:44:58","slug":"run-code-on-reject-after-previous-acceptance","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/run-code-on-reject-after-previous-acceptance\/","title":{"rendered":"Run code on Reject (after previous acceptance)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I&#8217;m using Option 4 here: <a href=\"https:\/\/support.mooveagency.com\/topic\/ga-gtm-consent-settings\/\">https:\/\/support.mooveagency.com\/topic\/ga-gtm-consent-settings\/<\/a> to load the first part of the script (consent denied \/ no cookies) and then loading the second part of the script (consent allowed \/ cookies ok) after ACCEPT is clicked. <br \/><br \/>However if REJECT is later toggled, GA cookies (e.g., <code>_ga<\/code>, <code>_gid<\/code>, <code>_gcl_*<\/code>) and the consent state will keep working until you explicitly send a revoke and clear cookies. <br \/><br \/>Is there a way to run additional code when REJECT is clicked? <\/p>\n","protected":false},"template":"","class_list":["post-18698697","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18698697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18698697\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18698697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}