Conditional canonical link in head custom code

@flow123 damn, so I’m stucked with the same problem.
@PixelGeek any ideas? maybe a work around it?

Regards guys!