I am using NopCommerce 3.7 with a plugin for affiliates. The issue I am running into is Google is seeing each affiliate page as a duplicate link. When I enable Canonical urls, the url produced is not the base url. Examples -
Here is what I want the canonical url to be whether there is a affiliate or not.
Attempting to use All in One widget to put java script in to make canonical link.
<p id="gcanonical"> </p> <p> <script>// <![CDATA[ var a = window.location.href; var b = a.split("/"); var c = b[3]; var d = '<link rel="canonical" href="http://metest.mebulbs.com/a/cd/' + c + '"/>' alert(c); alert(d); document.getElementById("gcanonical").innerHTML = d; // ]]></script> </p>
The alerts show the proper strings in var's, but when view source is used, the finished var does not appear.