Purpose: To integrate and test an optical tracking platform for motion detection in scanned ion beam tracking for organmotion compensation.Methods: An infra‐red optical tracking system (IR‐OTS) has been integrated into the treatment control system to test beam tracking for organmotion compensation in the framework of a nearly clinical scenario. The IR‐OTS provides the 3D localization of infrared reflective fiducials with sub‐millimetric accuracy at 100 Hz frame rate. A dedicated modular software application has been designed to assist in‐room motion capture and to encapsulate external‐internal correlation models for tumormotion estimation. Digital UDP protocol has been selected for data communication. Delays caused by motion detection process and data communication have been measured experimentally and compensated by means of time prediction. The three‐dimensional motion mitigation capability of the integrated system has been assessed by measuring the dosimetric deviations between static and motion compensated irradiations. As detector, an array of pinpoint ionization chambers was mounted on the target which was moved by a robotic arm (amplitude: 20 mm peak‐to‐peak). Results: Time delays for motion detection and data communication were estimated around 30 msec. Compensating a regular motion resulted in dosimetric deviations, with respect to the static case, of lower than 7% (neural‐network estimated compensation, no time prediction) and 2% (direct compensation, 30 msec time prediction). Dedicated experimental testing after code optimization allowed assessing overall detection and communication delays of 16.5±7 msec (median±quartile), to be used for the fine tuning of the time predictor. Conclusion: An optical tracking device for tumormotion estimation has been integrated into the experimental setting for treating moving targets with scanned ion beams. Future activities will focus on the optimization of the IR‐OTS integration and on the testing of neural estimators with retraining capabilities for managing irregular clinical like breathing patterns. This work has been supported by the ULICE EU FP7 Program.