I came up with a solution and thought I would share.
1. In my Mailchimp account I create the group name ‘Location’ under my single list
2. In S2Member->General Options->Registration/Profile Fields & Options I created a new field with the unique id ‘location’ and configured this as a drop down menu with the appropriate fields.
3. In S2Member->API/List Servers->MailChimp Integration I entered my single Mailchimp list ID number under free users
4. I SSHed to my webhost and created the file wp-content/mu-plugins/s2-hacks.php and entered the following code:
<?php
add_filter("ws_plugin__s2member_mailchimp_merge_array", "my_filter", 10, 2);
function my_filter($merge, $vars)
{
$user_id = $vars["user_id"];
$user_custom = get_user_option("wp_s2member_custom_fields", $user_id);
$mc_group_val = $user_custom['location']; //use your unique field id from step 2 here
$interest_group = array ("GROUPINGS" => array (array ("name" => 'Location', "groups" => $mc_group_val))); //where name is the Group name created in MailChimp (e.g. Location)
return array_merge($merge, $interest_group);
}
?>
I hope this may help others as it took me quite some time to figure this out.
Good luck,
Regis