-
Notifications
You must be signed in to change notification settings - Fork 68
Include Exclude Mailchimp Script
khungate edited this page Jul 25, 2023
·
4 revisions
Welcome to the guide on controlling the inclusion or exclusion of the Mailchimp script in the MailChimp for WooCommerce Integration. This guide will help you understand how to use a developer filter to check whether or not the script should be loaded.
We provide a developer filter to control the loading of the Mailchimp script. This feature was added in response to support requests for the ability to load the Mailchimp script only on certain pages of the site.
Here's an example of how to use the filter:
function mailchimp_should_add_script_on_this_page() {
return true;
}
add_filter('mailchimp_add_inline_footer_script', 'mailchimp_should_add_script_on_this_page');
-
return true;
means the script will be loaded. -
return false;
means the script will NOT be loaded. - You must determine whether or not the script should load through your custom function. We do not make any assumptions. The default value is true.