Marking and avoiding poor-quality resources can be an important mechanism by which animals lacking a spatial memory can maximize their foraging efficiency. Here, we investigate the behaviour of larval Harmonia axyridis ladybeetles that leave chemical tracks as they forage. We built a model of an individual larva foraging for aphids, parameterized it using experimental data, and used the model to predict the effect of larval track production and detection on foraging efficiency, an important component of fitness. The model predicted that there is an optimal sensitivity of larvae to tracks which maximizes foraging efficiency; if the larva is too sensitive to tracks, it will avoid areas that might still contain resources, whereas if it is too insensitive, it will forage in areas that have depleted resources. Furthermore, the increased efficiency conferred by detecting tracks depends on the spatial arrangement of resources, with more aggregated resource distributions allowing greater benefits of detecting tracks. We tested the predictions of the model experimentally by measuring predation on aggregated versus dispersed soybean aphids by H. axyridis larvae whose ability to produce tracks was experimentally manipulated. The experiments corroborated the results of the model: larvae that could produce tracks consumed more aphids than those that could not, and this difference was greatest when aphids were aggregated among plants. Our results suggest that larval tracks play an important role in foraging efficiency, and we discuss implications for the evolution of larval track production and detection in ladybeetles.