AEM as cloud | SEO | structured data markup | Community
Skip to main content
Level 5
August 30, 2023
Solved

AEM as cloud | SEO | structured data markup

  • August 30, 2023
  • 1 reply
  • 1039 views

Hi Folks,

 

As part of SEO best practice, I need to attach 'structured data markup' at page level 

using script type="application/ld+json"

Which has some other attributes like page name, description, org name etc

Each page has it's detail in this script.

How could I do this in AEM as cloud service?

 

Any pointers is highly appreciated. 

 

Thanks,

Pradeep

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sady_Rifat

Hello @pradeepdubey82 ,
You can use Sling Deligation Pattern and write your desired Json scheme in Java.

after that, you can use it on your page.html

<script type="application/ld+json">${page.schemaJsonLD @context='unsafe'}</script>


Another way,
You can directly add your LD script to page.html and fill properties via ${properties.title} and so on.
But I would recommend the 1st one.

1 reply

Sady_Rifat
Community Advisor
Sady_RifatCommunity AdvisorAccepted solution
Community Advisor
August 30, 2023

Hello @pradeepdubey82 ,
You can use Sling Deligation Pattern and write your desired Json scheme in Java.

after that, you can use it on your page.html

<script type="application/ld+json">${page.schemaJsonLD @context='unsafe'}</script>


Another way,
You can directly add your LD script to page.html and fill properties via ${properties.title} and so on.
But I would recommend the 1st one.