Delete Marketo Tracking Cookie

September 9, 2014 | by

Additional Note: This method should only be used if the desired effect is to remove the cookie entirely.  In most other cases, this method should be used.

This code sample can be used to delete a Marketo tracking cookie from a user’s browser after Marketo form submission. It works by calling deleteMarketoCookie method after a user submits a form. This method expires the cookie by setting the expiration date to a date in the past. The default behavior of the browser is then to delete this cookie because it is expired.