Canonical tag on dynamic page

Hi,

Has anyone managed this yet?

$w.onReady(function () {
    $w('#dynamicDataset').onReady(() => {
      link = wixLocation.url;
      console.log(link);
      let canonicalTag = '<head><link rel="canonical" href='link'/></head>'
       $w("#htmlCanonical").postMessage(canonicalTag);
   });
});

I do that but as you can see


I get the correct link


Best,
Yair

1 Like