The key to getting the coconut to stick to the cake is to put the coconut on while the buttercream is still fresh. I like to use a lined a baking sheet with parchment paper to catch any wayward shredded coconut that doesn't immediately stick to the cake. That way I can make a funnel of sorts out of the parchment paper, pour the coconut back into a bowl and use it to finish decorating the cake.