Purpose: Implanted fiducial markers are often used in radiotherapy to facilitate accurate visualization and localization of tumors. Typically, such markers are used to aid daily patient positioning and to verify the targets position during treatment. This work introduces a novel, automated method for identifying fiducial markers in planar x-ray imaging. Methods: In brief, the method consists of automated filtration and reconstruction steps that generate 3D templates of marker positions. The normalized cross-correlation was the used to identify fiducial markers in projection images. To quantify the accuracy of the technique, a phantom study was performed. 75 pre-treatment CBCT scans of 15 pancreatic cancer patients were analyzed to test the automated technique under real life conditions, including several challenging scenarios for tracking fiducial markers. Results: In phantom and patient studies, the method automatically tracked visible marker clusters in 100% of projection images. For scans in which a phantom exhibited 0D, 1D, and 3D motion, the automated technique showed median errors of 39 $mu$m, 53 $mu$m, and 93 $mu$m, respectively. Human precision was worse in comparison. Automated tracking was performed accurately despite the presence of other metallic objects. Additionally, transient differences in the cross-correlation score identified instances where markers disappeared from view. Conclusions: A novel, automated method for producing dynamic templates of fiducial marker clusters has been developed. Production of these templates automatically provides measurements of tumor motion that occurred during the CBCT scan that was used to produce them. Additionally, using these templates with intra-fractional images could potentially allow for more robust real-time target tracking in radiotherapy.