Spread the coconut flakes in an even layer on a baking sheet. Bake at 350 degrees Fahrenheit for a 3 to 4 minutes, or until the flakes are golden brown. Then, remove them from the oven and allow the coconut flakes to cool completely.
After giving your coconut flakes time to cool, brush the rim of your cocktail glass with agave syrup.
Spread the coconut flakes on a plate and place the rim into the flakes. Twist the rim to coat the edge of the glass in coconut, then place the glass in the freezer to chill.
In a cocktail shaker, add ½ cup of ice. Then, add the guava puree, tequila, lime, pineapple juice, and cream of coconut. Place the lid on the shaker and shake well for 30 seconds.
Remove the glasses from the freezer and fill each cup with ice. Strain the margarita over the fresh ice, then garnish with a lime wheel before serving.