Title: Adding Interest Groups Programmatically
Last modified: September 21, 2017

---

# Adding Interest Groups Programmatically

 *  Resolved [kbadr](https://wordpress.org/support/users/kbadr/)
 * (@kbadr)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/adding-interest-groups-programmatically/)
 * I am using the Custom Form Integration to add a mailchimp subscribe action to
   Event Manager’s checkout page. I added a booking form field called mc4wp-subscribe
   through the Events Manager form editor.
 * Subscribing to a list is working, but I would now like to specify interest group
   values based on what the person just purchased. Is that something that I can 
   do using a wordpress action? What call would I add to make Mailchimp for WordPress
   alter the data being sent to Mailchimp.
 * And is there a way to specify the interest group names and values by name, rather
   than ID? In the old Mailchimp integration, for example, I would specify:
 *  ‘GROUPINGS’=>array(
    array(‘name’=>’Email Categories’, ‘groups’=>’Hideout Audience
   Updates’)
 * before sending the call through the API.
 * But it looks like all the form generation in the Mailchimp for WordPress uses
   interest IDs and value IDs to send data to Mailchimp. If I have to do it by ID,
   I could, but it would be a little clunky.
    -  This topic was modified 8 years, 8 months ago by [kbadr](https://wordpress.org/support/users/kbadr/).
    -  This topic was modified 8 years, 8 months ago by [kbadr](https://wordpress.org/support/users/kbadr/).
    -  This topic was modified 8 years, 8 months ago by [kbadr](https://wordpress.org/support/users/kbadr/).

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

 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/adding-interest-groups-programmatically/#post-9519639)
 * Yes, the new MailChimp API v3 handles interest groups a bit different from v2.
 * Custom code is out of scope for our free support. I hope the following snippet
   is helpful for your case: [https://github.com/ibericode/mc4wp-snippets/blob/master/integrations/woocommerce/add-to-grouping.php](https://github.com/ibericode/mc4wp-snippets/blob/master/integrations/woocommerce/add-to-grouping.php)
 * Hope that helps!
 * Kind regards,
 *  Thread Starter [kbadr](https://wordpress.org/support/users/kbadr/)
 * (@kbadr)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/adding-interest-groups-programmatically/#post-9521339)
 * Thank you for confirming my suspicions. I have a few ways I can handle this, 
   though they’re a little less than ideal.

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

The topic ‘Adding Interest Groups Programmatically’ is closed to new replies.

 * ![](https://ps.w.org/mailchimp-for-wp/assets/icon-256x256.png?rev=1224577)
 * [MC4WP: Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-for-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-for-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-for-wp/reviews/)

## Tags

 * [integrations](https://wordpress.org/support/topic-tag/integrations/)
 * [Interest Groups](https://wordpress.org/support/topic-tag/interest-groups/)

 * 2 replies
 * 2 participants
 * Last reply from: [kbadr](https://wordpress.org/support/users/kbadr/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/adding-interest-groups-programmatically/#post-9521339)
 * Status: resolved