<h4>Background</h4>This study aimed to compare the safety and effectiveness of glucagon-like peptide-1 receptor agonists (GLP-1 RA) versus dipeptidyl peptidase-4 inhibitors (DPP-4i) in patients with type 2 diabetes following gastrostomy.<h4>Methods</h4>We conducted a target trial emulation using real-world data. Here, GLP1R is linked to type 2 diabetes mellitus.