The clicking should only happen ever time you step on the brake pedal. Yes?
The device that detects "which gear you are in" is mounted to the transmission (called the "Multi-function Transmission Range Switch".
See attached image.
Image (Click to make bigger)
Monday, January 6th, 2020 AT 12:48 PM