Thanks Alain for the response. I did what you told me and it works.
$response = $gdata->performHttpRequest('GET', '
https://www.google.com/m8/feeds/groups/default/full');
$xmlBody = strstr($response,'<?xml');
$xml = simplexml_load_string($xmlBody);
$groupId = $xml->entry[0]->id;
// add group
$group = $doc->createElement('gContact:groupMembershipInfo');
$group->setAttribute('deleted' ,'false');
$group->setAttribute('href' , $groupId);
$entry->appendChild($group);
// insert entry
$entryResult = $gdata->insertEntry($doc->saveXML(), '
http://www.google.com/m8/feeds/contacts/default/full');