mailchimp / mc-woocommerce

MailChimp for Woocommerce Integration. Syncs all data (subscriber, customers, orders, products) and enables marketing automation with email campaigns, automations, ads, postcards and more.
https://wordpress.org/plugins/mailchimp-for-woocommerce/
GNU General Public License v2.0
82 stars 66 forks source link

WooCommerce is not syncing all user data in the MailChimp Audience. #1088

Closed inventivewebdesign closed 8 months ago

inventivewebdesign commented 10 months ago

Description: I am using the MailChimp for WooCommerce plugin (https://wordpress.org/plugins/mailchimp-for-woocommerce/).

We have a site selling event tickets using The Events Calendar integrated with WooCommerce.

If you attempt to purchase a ticket here: https://adamsplacelv.org/adams-place-event/webinar-working-with-grieving-children-facilitating-expressive-arts-activities/ it will take you to the WooCommerce Cart (https://adamsplacelv.org/cart/) and/or Checkout (https://adamsplacelv.org/checkout/) pages. These use the standard WC install.

Problem: When someone checks out (purchasing a ticket in WooCommerce) we are not receiving all of thier information in MailChimp.

What we get:

  1. The users First Name shows up in the First and Last Name field
  2. Their Email shows up in the Email Address Field
  3. We do get their order info and/or abandoned cart info in Activity (this shows that the connection with the plugin is working correctly).

What we don't get (but would like to get):

  1. The user's First Name in the First Name field
  2. The user's Last Name in the Last Name Field
  3. The user's Phone Number in the Phone Number field.

Here is a screencast to express what I am saying: https://watch.screencastify.com/v/1pG1PF8Xb62HV6eWCpEU

All I want to know right now is why the standard WooCommerce Checkout fields like first name, last name and phone number do not get added to the correct place in the MailChimp contact.

Just as a note, I didn’t actually make a purchase in the video above but am referring to the previous purchase I made . I have double checked this with a recent purchase to confer that other users are also not getting all of their information added to Mailchimp.

Once again, we are using your plugin to do this: https://wordpress.org/plugins/mailchimp-for-woocommerce/ Some of the things it says on this plugin page that are important:

  1. Sync to your Audience in Mailchimp with purchase data (purchase data does come in).
  2. Sync new subscribers to your Audience when they create an account and opt-in (user's don't necessarily create an account upon checkout).
  3. Customers are subscribed to your Audience when they opt-in at checkout or when an account is created (this says that they should be added to our audience on checkout even without an account).

Operating environment (please complete the following information):

These were the versions when I ran the tests and for the most recent purchases. I have updated to the most recent versions now.

khungate commented 9 months ago

Hi @inventivewebdesign, thanks for your patience. At this time phone numbers do not sync to Mailchimp as a merge tag. As a workaround, you might want to explore the use of custom merge tags, as documented in the Mailchimp for WooCommerce Custom Merge Tags guide. This approach allows for additional user data fields, like phone numbers, to be synced.

Would this approach align with your situation?

inventivewebdesign commented 9 months ago

I know that they don't sync. I did see some posts about Custom Merge tags I have researched it further and tried this code:

/**
 * This will send additional WooCommerce checkout fields to MailChimp.
 *
 * @return array
 */
add_filter( 'mc4wp_integration_woocommerce_data', function( $data, $order_id ) {
    $order = wc_get_order( $order_id );

    // this sends the billing_phone field from WooCommerce to a Mailchimp field called "PHONE". 
    // I recommend using a text field, so that any format of phone number will pass validation in Mailchimp.
    $data[ 'PHONE' ] = $order->get_billing_phone();

    return $data;
}, 10, 2);

I seems like it should pull the billing phone from WooCommerce and drop in into Mailchimp. I created a text field and Merge tag in MailChimp of |PHONE| but nothing comes into the system. Not sure what is causing this to not function. Any ideas on this code?

ryanhungate commented 9 months ago

@inventivewebdesign this hook you're referring to is from a different plugin :) This is the "Mailchimp for WooCommerce" plugin and the one you're referring to is the Mailchimp for Wordpress plugin. Are we getting any wires crossed on this one?

We have a wiki for custom merge tags for the user here.

We have a wiki for the custom merge tags for when an order is updated here.