POST
/
revokeCookieConsent
Revoke cookie consent
curl --request POST \
  --url https://js.hs-scripts.com/revokeCookieConsent \
  --header 'Content-Type: application/javascript' \
  --data '"_hsq.push(['\''revokeCookieConsent'\'']);"'
Remove the consent banner cookies for a visitor, such as for GDPR deletion requests.

Usage

var _hsq = window._hsq = window._hsq || [];
_hsq.push(['revokeCookieConsent']);

Use Cases

  • GDPR Compliance: Handle “right to be forgotten” requests
  • Privacy Settings: Allow users to revoke their consent
  • Data Deletion: Remove tracking consent as part of account deletion
  • Privacy Reset: Clear consent status for testing or troubleshooting

Notes

  • This function removes the consent banner cookies from the visitor’s browser
  • The visitor will see the consent banner again on their next visit
  • This does not delete historical data from HubSpot - it only affects future tracking
  • Use this in conjunction with other data deletion processes for complete GDPR compliance

Body

application/javascript · object

Revoke consent request

The body is of type object.

Response

200

Cookie consent revoked successfully