Purpose: To implement patient-specific planning target volume (PTV) margins for liver radiation therapy treatments. Methods and Materials: Treatment log files are analyzed to assess tumour motion-tracking accuracy. A uniform PTV margin is estimated that considers motion-tracking errors and deformations, provided that the impact of uncorrected rotations is minimized. A supervised machine learning algorithm is used to investigate if motion-tracking errors are less than 2 mm, and consequently, the standard PTV margins can be reduced by 2 mm. We employ a warning system that quantifies the probability of a geographic miss if the PTV margin is reduced for every subsequent fraction. A dosimetric analytical tool is proposed to retrospectively assess the dose to a target against different types of delivery errors. The tool is validated by radiochromic film measurements for liver and trigeminal neuralgia treatments. Case studies are conducted to access the suitability of a selected PTV margin based on the geometrical and dosimetric coverage of targets. The range of rotations that can be safely allowed for trigeminal neuralgia treatments is quantified since rotational corrections cannot be applied by the system for this specific disease site. Results: Isotropic 4 mm PTV margins are sufficient to account for tracking errors and deformations for 95% of patients. The accuracy of predicting if motion-tracking errors are less than 2 mm is 0.84 ± 0.06 using 5-fold cross-validation. Using the warning system, 11 out of 64 cases predicted to be treated with 2 mm reduced PTV margins might require replanning, but for each fraction they have more than 96% of target(s) encompassed by the reduced PTV. For experiments with different types of geometrical errors the dose measurements agree well (2%/2 mm level) with the dose distributions estimated using the dosimetric analytical tool. Dose to targets considering delivery errors can be significantly improved if treatments are planned following certain guidelines. For trigeminal neuralgia treatments, target rotations of up to 1° can be safe for some patients. Conclusions: It is feasible to implement patient-specific PTV margins in the clinic, assisted with an early-warning system and dosimetric analytical tool to warn of a potential geographic miss and underdosing of target(s).