15. A non-transitory computer storage medium encoded with a computer program, the program comprising instructions that when executed by a data processing apparatus cause the data processing apparatus to perform operations comprising: receiving a content item request that includes context data specifying a user group that will be presented a content item and a resource on which the content item will be presented; in response to receiving the content item request: identifying a given content item that is eligible to be presented in response to the content item request; identifying a template feed from which a template for the given content item is to be selected, the template feed including a set of templates; determining, for each particular template from the set of templates, a contextual performance measure based on (i) a performance of one or more first content items when the particular template has been used to create the one or more first content items for presentation in response to content item requests that included a particular attribute of the context data and (ii) a performance of one or more second content items when the particular template has been used to create the one or more second content items for presentation with the resource; selecting, from the template feed and based on the contextual performance measure of each template in the set of templates, a template for the given content item; populating the selected template with content for the given content item to create a formatted content item; and providing the formatted content item in response to the content item request.
15. A non-transitory computer storage medium encoded with a computer program, the program comprising instructions that when executed by a data processing apparatus cause the data processing apparatus to perform operations comprising: receiving a content item request that includes context data specifying a user group that will be presented a content item and a resource on which the content item will be presented; in response to receiving the content item request: identifying a given content item that is eligible to be presented in response to the content item request; identifying a template feed from which a template for the given content item is to be selected, the template feed including a set of templates; determining, for each particular template from the set of templates, a contextual performance measure based on (i) a performance of one or more first content items when the particular template has been used to create the one or more first content items for presentation in response to content item requests that included a particular attribute of the context data and (ii) a performance of one or more second content items when the particular template has been used to create the one or more second content items for presentation with the resource; selecting, from the template feed and based on the contextual performance measure of each template in the set of templates, a template for the given content item; populating the selected template with content for the given content item to create a formatted content item; and providing the formatted content item in response to the content item request. 17. The non-transitory computer storage medium of claim 15 , wherein the one or more second content items include the given content item.