Wash and dry both sides of the fitting, and clean the external fitting and the attachment point at the tank.
Rub the fitting's inside edge and the external connection point on the tank with sandpaper. This makes the PVC surface porous and ready to absorb the waterproof PVC glue.
Apply a coat of the glue to each of the sanded areas. Connect the fixtures and give time to dry as per the glue instructions. Wipe away any excess glue from the area before it dries.
Test the connection by pulling it with your hands to ensure it has dried and sealed properly.