To add this open /Views/Product/ProductTemplate.Simple.cshtml and /Views/Product/ProductTemplate.Grouped.cshtml. Replace this line,
Html.AddHeadCustomParts("<meta property=\"og:url\" content=\"" + Request.Url.AbsoluteUri + "\" />");
with this,
if (seoSettings.CanonicalUrlsEnabled) {
Html.AddHeadCustomParts("<meta property=\"og:url\" content=\"" + Url.RouteUrl("Product", new { SeName = Model.SeName }, this.Request.Url.Scheme) + "\" />");
} else {
Html.AddHeadCustomParts("<meta property=\"og:url\" content=\"" + Request.Url.AbsoluteUri + "\" />");
}
Basically it checks to see whether canonical URLs are enabled and, if so, shows the canonical URL instead of the absolute URI (that may contain query strings and doesn't include language codes).