Groups and tags
Groups and tags are two key methods of organising data in CiviCRM. When used properly, both allow for powerful segmentation and searching of your database.
Since both groups and tags are methods of categorisation, it can be difficult to determine whether a tag or a group is more appropriate in a given situation. Identifying the differences in their functionality will help you to decide which to use.
It can also be good to have a conceptual understanding of the differences between the two. Though there are different takes on how tags and groups should be used, a common philosophy is that tags should be used for descriptive categories and groups should be used for grouping people within an entity that needs to be treated like a cohesive unit (to send mailings to, for example). From this perspective, things like volunteer, ally organisation, vegetarian, and musician would be tags with which you could categorise contacts while Volunteer Committee, Allied Organisations Coalition, Vegetarian Newsletter, and This Awesome Band With A Bad Name would be groups to which you could add contacts.
Groups are an incredibly important feature within CiviCRM. In addition to their fundamental use as collections of contacts that have something in common, they play a critical role in CiviMail and Profiles, and can be used to set up advanced access rights (on Drupal). Well-defined groups are one of the most important tools available when segmenting your CiviCRM contact database.
There are two kinds of Groups – Regular Groups and Smart Groups.
- Regular Groups allows you to manually place contacts into a group. For example, you can manually assign your organisation's board members to a Board of Directors regular group. You can then easily send board-related emails to each person who is a member of the Board of Directors group without having to search through CiviCRM and select each member individually for the mailing.
- Smart Groups are automatically populated groups that are configured to include contacts that share a certain set of characteristics or activities. As contacts are added or edited, CiviCRM automatically checks them and adds them to Smart Groups if they meet the characteristics that you have configured. For example, you can create a Smart Group for "2010 Contributors from California" that includes contacts who have made a contribution in the year 2010 (an activity) and have an address in California (a characteristic). When new contacts located in California make a contribution in 2010, they are automatically added to this group. Another example is a Smart Group of all donors who have not yet been sent a thank-you letter. As you send your letters, the donors receiving them will automatically leave the smart group, allowing you to always have an accurate list to work from.
Group settings and functionality
Each group should have a clear, easily understandable group name and a description of its purpose that other database users will be able to understand. Both the name and the description should allow users to quickly figure out what particular groups are for when working in different contexts (e.g. CiviMail). This clarity and specificity is especially important once your organisation has amassed many different groups. If a group is created for a specific person within your organisation, it is a good idea to mention who the group owner is in the description so that in the future someone can check if this group is still used or if it can be deleted.
Groups can be assigned the following types:
- Mailing List is used if you plan to use this group as a mailing list in CiviMail. This group type is available for both Regular and Smart Groups.
- Access Control (Drupal only) is used to assign CiviCRM access permissions to a set of contacts. Only Regular Groups can be assigned the Access Control group type.
Visibility determines permissions for joining and removing contacts from groups. Select "User and User Admin Only" if membership in this group is controlled only by authorised CiviCRM users. Select "Public Pages" if you want to allow contacts to join and remove themselves from this group via Registration and Account Profile forms.
Some organisations find it useful to create a hierarchy of groups. In CiviCRM, this is done by creating one or more parent groups and then assigning other groups to them. When a user sends a mailing to a parent group or searches for contacts in a parent group, all contacts in the associated child groups are automatically included.
For example, an organisation that has a national office and 5 regional offices puts constituents in each region into their own group. Then they create a National group which is assigned as the parent group for all regional groups. The national office can now send mailings to the National group, knowing that all contacts in the regional groups that are children of the National group will be included.
CiviCRM assigns a unique numeric ID to each group. These group IDs can be used for a variety of operations. For example, the group ID can be used to define a URL for group sign-ups. You can find a group's ID by checking the ID column in the tabled list of groups at Navigation Menu > Contacts > Manage Groups.
Tags are used to categorise contacts, activities and cases in CiviCRM. You can create as many tags as needed to classify the contacts in your database, though it is advisable to avoid duplicating existing tags or adding too many tags that aren't really necessary. It can be useful to create a standard process for creating and using tags within your organisation to avoid these problems.
Groups versus tags
This is a common question on any project, and the philosophy described in the introduction of this chapter is a guideline, but rules might need to be bent based on how you intend to use your contact segmentation.
One interesting benefit of having both groups and tags is that you can perform more refined searches using AND and OR. For instance, if you have journalists, volunteers and members as groups and use tags to identify topics of interests such as development, art and history, you can find all the journalists who are interested in art or development, all the volunteers or members that are interested in history, or any other combination.
Beside that, groups have some features that tags don't:
- Groups are integrated into several other CiviCRM functions (most notably CiviMail).
- Contacts can be added to smart groups automatically based on characteristics.
- Groups can be associated to Drupal Organic Groups.
Think of it this way: tags can be applied to contacts, activities, and cases, whereas groups can only consist of contacts.
Adding and removing contacts to groups and tags
You can add contacts to groups in multiple ways:
- through the Tags and Groups section of the Contact Details edit screen
- through a contact's Groups tab
- by using the "Add Contacts to Group/Tag contacts" batch action after conducting a search
- by clicking a group's Contacts link in Navigation Menu > Contacts > Manage Groups.
The first two methods also allow you to remove individual contacts from a group. The last two methods allow you to add multiple contacts to groups at once.
Individual contacts can be added to a Group either in the contact edit screen or via the Groups tab. Multiple contacts can be added to a group at once by conducting a search, and then selecting Add Contacts to a Group using the More Actions menu. The second way allows you to add multiple contacts to a group by going to Manage Groups, selecting Members for the relevant Group and then using the Add Members to this Group option at the top of the screen.
Contacts can also be added to a group as a result of filling out a Profile (see below).
To view and manage all groups, go to: Navigation Menu > Contacts > Manage Groups.
You can use the Find Groups form at the top of the Manage Groups screen to search for groups by name, type, visibility and whether the group is enabled or disabled. You can also scroll or browse through the list of groups further down the Manage Groups screen. This list includes both regular and smart groups.
- add contacts to a group by clicking the Contacts link in the group's row
- edit the group by clicking the Settings link
- disable or delete a group using the links in the "more" pop-up menu.
Finding contacts in a groupThe Contacts page for each group includes a form for finding contacts within the group. You can search contacts within a group by name, email address, contact type, group status (added, removed, or pending) and tags.
Creating smart groups
Smart group are useful in many different situations. They are often used to assist organisational workflows. For instance, when you find yourself doing the same search over and over on your contacts, you can save the search as a smart group. Whenever you select that group, CiviCRM will run the search and display the results. Any new contacts that meet the search criteria will be added to the group, and contacts that no longer meet the criteria will be removed from the group.
Smart groups can be created from the search results generated by any of the search forms. For example, you can create a smart group of all donors who have not yet been sent a thank-you letter. As you send your letters, the donors receiving them will automatically leave the smart group, allowing you to always have an accurate list to work from. To create this smart group:
Go to Search > Find Contacts > Advanced Search.
Scroll down to the Contributions section and click on Contributions.
Check "Thank-you date not set?" and choose Donation from the Contribution Type dropdown menu.
Click Search at the bottom of the page.
Click the button that selects all the records
From the " - more actions - " dropdown menu select New Smart Group, then click Go.
The next screen provides a review of the criteria chosen for the smart group. Give the smart group a name, a description (optional) and decide if you want to make this smart group a Mailing List (allowing you to include the smart group in CiviMail). Then click Save Smart Group.
You can view your smart group by going to: Contacts > Manage Groups where you will see your smart group in the list.
Updating Smart Groups
It's possible to edit and update the criteria you originally chose to create your smart group. For example, you may edit a smart group consisting of all current members to include new members as well.
Click Manage Groups. To edit the search criteria of a particular smart group, click Settings next to that group.
Click Edit Smart Group Criteria at bottom left.
Click Edit [name] Smart Group Criteria to make the needed changes.
Click Search. Once you have the search results you want, choose the radio button All [number] Records.
From the drop-down list of actions, choose Update Smart Group and click Go.
Your smart group is now based on the new criteria.
Groups and ACL
Access Control Lists (ACL) provide finer grained permissioning than what is available through Drupal's Permissions and Roles. Setting up ACLs requires a good understanding of the concept, which is thoroughly explained in the online CiviCRM documentation here: http://wiki.civicrm.org/confluence/display/CRMDOC/Access+Control
As with many processes, the key is to make sure you have assembled all the parts before you try to join them together. In this case, you must set up the required Groups, Custom Data Groups, Profiles and Roles before you can use them in ACL.
Note that ACL support for Joomla was introduced in Joomla version 1.6.
Groups and Organic Groups (Drupal only)
The Organic Groups CiviCRM module (http://drupal.org/project/og_civicrm) integrates Organic Groups from a Drupal site with CiviCRM groups. This is useful for groups that require Organic Group functionality on their website but also need to be tracked within CiviCRM. Once an Organic Group of Drupal users are integrated into CiviCRM, the Drupal group can be used for mailings, tracking address information, tracking activities or anything else normally done with CiviCRM contacts.
Once the Organic Groups CiviCRM module is installed and enabled in Drupal it automatically creates two CiviCRM groups for each existing Drupal Organic Group:
- A normal group containing a contact record for each corresponding user who is part of an Organic Group. This group is assigned the same name as the linked Organic Group.
- An access control group containing the contact record of the administrator of the corresponding Organic Group. This gives the OG group admin the ability to view and edit members of their group in CiviCRM.
The groups are synchronised one way only, from the Drupal Organic Groups to CiviCRM groups. When a new user is added to or signs up for an Organic Group, they are automatically added to the corresponding CiviCRM group. If they leave the Organic Group then they are removed from the CiviCRM group. If an Organic Group is deleted, the CiviCRM group is also deleted. However, the reverse of each of this situations is not true; a contact added to the CiviCRM group will not appear in the Drupal Organic Group, a contact removed from the CiviCRM group will still remain in the Drupal Organic Group, and if you delete the CiviCRM group, the Drupal Organic Group will still remain. Therefore, this integration is meant to be used when you administer the group from the Drupal side.
Working with tags
To view tags, go to: Contacts > Manage Tags (Categories) in the navigation menu.
A tag can be edited or deleted using the respective links in its row. New tags can be created by clicking the Add Tag button on the Manage Tags (Categories) screen or by going to Contacts > New Tag in the navigation menu.
Each tag should have a clear and unique name and an explanatory description to help users understand the tag's purpose. Tags can be structured hierarchically and designated as subtags of an existing tag by selecting a Parent tag from the dropdown list.
Tags can be designated for use for contacts, activities and/or cases. If a tag is designated for use for contacts, it will be available for all contact types and subtypes; tags cannot be specifically designated for use for only one type of contact.
Tags are a flexible tool and every user can create more if needed. However, very important tags can be locked to prevent them from being modified or deleted by users who do not have the "administer reserved tags" permission (this permission is available in Drupal only).
Tags can be assigned to contacts, activities and cases in the following ways:
- while creating or editing the record
- from the Contact Summary Tags tab
- by using the Tag Contacts batch action after conducting a search.
Tag sets allow you to create free tagging taxonomies which users can add their own tags on the fly, without having to access the Manage Tags page described above.
Tag sets are created by going to: Contacts > Manage Tags (Categories) in the navigation menu and clicking the Add Tag Set button. Tag sets are configured identically to regular tags. However, they function quite differently. When you create a new tag set, it creates a new field on the edit pages of the entity's activities or cases as well as in the Tags tab for contacts.
This is a tokenising autocomplete field: as you begin to type, CiviCRM looks for matching tags in this tag set and displays any matches below the field. You can select an existing tag or create a new one by typing the entire tag and pressing the Enter key. The tag will then appear within the field in a box. Clicking on the X will untag the entity (contact, case or activity) that you are editing.
Tags created within a tag set can be viewed and edited from the normal Contacts > Manage Tags (Categories) list. However, tags created within a tag set will only be available within that particular tag set.