Add the cranberries, water, sugar and sliced ginger to a medium saucepan.
Bring to a gentle simmer over medium heat, stirring now and then, until the cranberries have burst and the sugar has dissolved, about 10 to 15 minutes.
Strain through a fine-mesh strainer into a heat-safe bowl or jar, pressing the solids lightly. Discard the solids.
Cool, then store the syrup in a clean, airtight container in the refrigerator.
For a soda or mocktail, add about 2 to 3 tablespoons of syrup to a glass of ice and top with 8 to 10 ounces of sparkling water. Stir gently. Garnish the mocktail if you like.
For a cranberry martini, shake about 2 ounces of vodka and 1 1/2 ounces of syrup with ice. Strain into a glass, add a splash of sparkling water, and garnish if you like.
For a cranberry Prosecco sparkler, add 1 to 2 tablespoons of cranberry syrup (homemade or store-bought) to a glass. Add 1 ounce of vodka or gin if you want an extra kick. Top with 4 ounces of chilled Prosecco. Garnish with fresh cranberries, frozen cranberries, or a rosemary sprig.