Canonical Tags | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

arunpatidar
Community Advisor
Community Advisor
June 19, 2018

Yes, you can do it by using Java/JS/HTL

In head, you can do something like below:

Head.js

use(function () {

    return {

        canonical:"https://aem63app.com"+currentPage.getPath()+".html"

    };

});

head.html

<sly data-sly-use.head="head.js">

<link rel="canonical" href="${head.canonical}"/>

<!--/* Include Context Hub */-->

Or you can use java and apply your business logic and return href value.

Thanks

Arun

Arun Patidar
exzyte
exzyteAuthor
Level 2
June 19, 2018

Hi Sir,

I don't have access to update/edit AEM templates.

I have tried adding canonical tag <link rel="canonical" href="https://www.samplelink.com/en/contactus.html" /> thru Adobe DTM but it is not reflecting on "view page source" and also on elements tab of Devtools.

regards

exzyte
exzyteAuthor
Level 2
June 19, 2018

Hi,

I want to understand how you are planning to implement Canonical Tag using DTM? Are you going to write something in DTM client script and injecting canonical tags like other tags? You can't add logger in below client side script or something to check if canonical tag is executing or not?

Dynamic Tag Management - Digital Marketing cloud service that allows a marketer to manage Adobe and third-party tags used for tracking or other analytic purposes. It is done through client-side scripting that injects tag related code throughout the pages of the site.

I am not aware of DTM, so not sure if you can inject other tags from DTM or you need to implement something in AEM.

Thanks

Arun


It is thru DTM we add those Google Analytics and other SEO codes which our AEM pages needed(ie. inside head tags, bottom of the page etc.).

We just paste the code and specify trigger rule and that's it.