The attack in Niger on U.S. and Nigerien troops followed an effort to track a target, U.S. officials say.