Commonly, larger mailchimp lists are segmented by interest groups to allow specific targeting without handling subscriber data on different lists.
Now if you want to import large amounts of already subscribed users, using the mailchimp api is the best solution. Scanning the mailchimp api docs of the listBatchSubscribe action I was not able to find any documentation on how to import subscribers to specific interest groups – should have read the listSubscribe docs too
. It turned out it is really simple. Just add an array of group information to your data rows using the key ‘GROUPINGS’ and you are good to go. Group information must contain the key ‘groups’ – a comma separated list of interests and either the group id or the name of the group you want to add your data to. ID, name and values of groups can also be listed using the listInterestGroupings method.
A simple example:
$batch = array(
array(
'EMAIL' => 'test@yourdomain.com',
'FNAME' => 'Test',
'LNAME' => 'Test',
'GROUPINGS' => array(
array('name' => 'MyGroup', 'groups' => 'Value1, Value3'),
array('id' => 15, 'groups' => 'Value2'),
)
);
$chimp->listBatchSubscribe($list_id, $batch, true, true, true);


