Religious adherence has been hard to study in part because it is hard to measure. We develop a new measure of religious adherence, which is granular in both time and space, using anonymized mobile phone transaction records. After validating the measure with traditional data, we show how it can shed light on the nature of religious adherence in Islamic societies. Exploiting random variation in climate, we find that as economic conditions in Afghanistan worsen, people become more religiously observant. The effects are most pronounced in areas where droughts have the biggest economic consequences, such as croplands without access to irrigation.