The study presented here describes the characterization and synthesis of a triazine-based covalent organic framework using different analytical procedures such as scanning electron microscopy, X-ray diffraction, energy dispersive X-ray spectroscopy, cyclic voltammetry, Brunauer-Emmett-Teller analysis, and electrochemical impedance spectroscopy. The synthesized COF was then utilized as an electrocatalytic modifier for the selective and sensitive determination of Pb 2+ and Cd 2+ at nanomolar levels via square wave anodic stripping voltammetry. A Plackett-Burman design was employed to screen operational parameters influencing the sensitivity of the electroanalytical method, followed by optimization of the significant variables using Box-Behnken design. A linear response over 1.0–110.0 nmol L 1 and 5.0–300.0 nmol L 1 range for Pb 2+ and Cd 2+ , with detection limits of 1.1 and 1.8 nmol L 1 , respectively. Furthermore, the selectivity of the presented electrode over different species was evaluated with no significant interference found. The sensor was applied effectively to determine of Pb 2+ and Cd 2+ ions in samples.