Skip to content

Enable or Disable Cookie Filter

khungate edited this page Jul 25, 2023 · 5 revisions

Welcome to the guide on enabling or disabling the Cookie Filter in the MailChimp for WooCommerce Integration. This guide will help you understand how to control the use of cookies for site shoppers.

Overview

Cookie Usage

By default, our plugin uses cookies to track cart data and ensure the correct population of the cart for each shopper. These cookies are stored for 30 days. However, we've received requests to disable cookies for site shoppers. To accommodate this, we've implemented a custom function that allows you to control whether or not a cookie should be allowed.

Code Example

Disabling Cookies

Here's an example of how to disable cookies:

function custom_cookie_callback_function($cookie_name) {
    return false;
}
add_filter( 'mailchimp_allowed_to_use_cookie', 'custom_cookie_callback_function', 10, 1 );

Please note that disabling cookies will result in the loss of abandoned cart Automations for all guest customers. However, logged-in users will continue to function as expected.

Cookie Details

mailchimp_user_email

This is the shopper’s email address. We use this to track cart data and also allow Mailchimp to send the shopper back to your site to reload the cart from any device and ensure the cart is populated correctly.

mailchimp_landing_site

This is the “first page” that the customer lands on.

mailchimp.cart.previous_email

This is for the use case where the customer “had” an email saved in the session but then changed it. We use this for deleting old cart data and starting fresh.

mailchimp.cart.current_email

This is the shopper's current email in session, to be compared against the “previous email” – but is directly related to the mailchimp_user_email.