Title: Sync with Mailchimp for WordPress
Last modified: June 11, 2019

---

# Sync with Mailchimp for WordPress

 *  [deyson](https://wordpress.org/support/users/deyson/)
 * (@deyson)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/sync-with-mailchimp-for-wordpress/)
 * Hello and good day.
 * I had wanted to sync the Group name a customer is in with MailChimp for WordPress
   Plugin using their extension.
 * This is the example code I had gotten here: [https://kb.mc4wp.com/syncing-custom-user-fields-mailchimp/#advanced-fields](https://kb.mc4wp.com/syncing-custom-user-fields-mailchimp/#advanced-fields)
 * add_filter( ‘mailchimp_sync_user_data’, function( $data, $user ) {
    $data[‘MERGETAG’]
   = $user->field_name; return $data; }, 10, 2 );
 * My question is how do I find the filed name of a group to use in MailChimp Sync.
 * Thank you and have an amazing day!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [gtsiokos](https://wordpress.org/support/users/gtsiokos/)
 * (@gtsiokos)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/sync-with-mailchimp-for-wordpress/#post-11711254)
 * Hi Deyson,
 * In case this is still requested, here is a solution you can use.
    First you need
   to get all the groups the user belongs to:
 *     ```
       $groups_user = new Groups_User( get_current_user_id() );
       $user_groups = $groups_user->groups;
       $user_group_ids = $groups_user->group_ids;
       $user_group_ids_deep = $groups_user->group_ids_deep;
       ```
   
 * And afterwards once you have the group ids, you can get the group names by looping
   the following like this:
 *     ```
       $each_group = Groups_group::read( $each_group_id );
       $each_group_name = $each_group->name;
       ```
   
 * Kind regards,
    George
 *  Thread Starter [deyson](https://wordpress.org/support/users/deyson/)
 * (@deyson)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/sync-with-mailchimp-for-wordpress/#post-11714098)
 * Hi! Thank you. Do I add this code to the code provided in the link in the original
   post?
 * Thank you 🙂
 *  [gtsiokos](https://wordpress.org/support/users/gtsiokos/)
 * (@gtsiokos)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/sync-with-mailchimp-for-wordpress/#post-11715967)
 * Hi Deyson,
 * Yes you need to add it there.
    Please keep in mind that there are further elements
   needed in order for this to function properly. Assuming that this is the correct
   hook to use, you need for example a loop to check each one of the group ids fetched.
 * FYI, in order to implement it you need to have strong PHP and WordPress API skills,
   otherwise it’s better to consult an experienced developer.
 * Kind regards,
    George
 *  Thread Starter [deyson](https://wordpress.org/support/users/deyson/)
 * (@deyson)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/sync-with-mailchimp-for-wordpress/#post-11717926)
 * Thank you! I will look for a developer. Where do you recommend that I look that
   could understand your plugin? Thank you 🙂
 *  [gtsiokos](https://wordpress.org/support/users/gtsiokos/)
 * (@gtsiokos)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/sync-with-mailchimp-for-wordpress/#post-11721588)
 * Hi Deyson,
 * A good place for this would be [https://jobs.wordpress.net/](https://jobs.wordpress.net/).
 * Cheers,
    George

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Sync with Mailchimp for WordPress’ is closed to new replies.

 * ![](https://ps.w.org/groups/assets/icon-256x256.png?rev=983146)
 * [Groups - Memberships and Access Control](https://wordpress.org/plugins/groups/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/groups/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/groups/)
 * [Active Topics](https://wordpress.org/support/plugin/groups/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/groups/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/groups/reviews/)

## Tags

 * [MailChimp for WordPress](https://wordpress.org/support/topic-tag/mailchimp-for-wordpress/)

 * 5 replies
 * 2 participants
 * Last reply from: [gtsiokos](https://wordpress.org/support/users/gtsiokos/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/sync-with-mailchimp-for-wordpress/#post-11721588)
 * Status: not a support question